Visual Studio – run as administrator

This is something that I generally forget whenever I create a new dev-box. Visual Studio needs to be running as Administrator otherwise you’ll get messages such as “Access to the path ‘K:\AosService\PackagesLocalDirectory\Bin\InstalledVersion.json’ is denied”:

Skærmbillede 2020-03-23 kl. 07.35.17.png

and “Visual Studio is not running as administrator. Finance and Operations (Dynamics 365) requires Visual Studio to be running as administrator. Please restart Visual Studio as administrator”:

Skærmbillede 2020-03-23 kl. 07.35.28.png

You can always right-click on your VS-shortcut and select “Run as administrator”, but if you’re even remotely like me, you’ll forget that approx 82% of the times.

So what you need to do is to modify the shortcut you’re using. In my case I modify the shortcut in my Taskbar. Right click on the shortcut for Visual Studio and instead of clicking “Run as administrator” you click Properties:

Skærmbillede 2020-03-23 kl. 09.27.35.png

In the properties window you click the Advanced button:

Skærmbillede 2020-03-23 kl. 09.29.37.png

In the window that opens up tick the “Run as administrator”:

Skærmbillede 2020-03-23 kl. 09.30.03.png

Click OK and OK and you’re done. Next time you use the shortcut it runs VS as administrator.

Updates tiles in LCS not updated

When looking at the hosted environments in LCS sometimes the tiles showing updates doesn’t seem to update probably. The symptoms could be that the numbers indicate that you’re missing some updates after updating it all or that the Last run date isn’t updating.

Tiles update outdated.PNG

The status is updated through a scheduled task on the server.

Task scheduler.PNG

It runs a powershell script in C:\LCSDiagnostics\ called CollectData.ps1


You can run it manually (through an elevated powershell) and that should hopefully update the figures.

It would have been nice to be able to see the run history on the task in the scheduler but for some reason that has been disabled:

History disabled.PNG

That is easily fixed. Open the Task scheduler as Administrator and that gives you the option in the right most part of the form:

Enable task history.PNG