BizTalk Server Tips and Tricks: Configure Visual Studio to run with elevated permissions (as administrator)

Published on : Jul 26, 2018

Category : BizTalk Server

Sandro

Author

With all these new security features present on the latest Microsoft operating systems, don’t get me wrong they are good, sometimes our life as BizTalk Developers seems like it’s reversing and becoming a nightmare, especially if you are a consultant working with multiple different clients, environments, and projects. Most of the times I start developing a new project at a new client, the first time I try to deploy a solution I get an “Error 87 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))…” error message. Visual Studio: BizTalk Server deployment fails There are several possible causes for you to get such Access Denied errors when deploying BizTalk solutions directly from Visual Studio. Most common is that you don’t have the right BizTalk privileges to deploy artifacts, or in other words, you are not a local Administrator. But most of the time is simpler than that and indeed is related with these additional securities setting present in recent Windows Server versions.

How do I run Visual Studio in elevated mode?

For you to be able to successfully deploy a BizTalk Server solution directly from Visual Studio, you must run Visual Studio as an Administrator, or with elevated permissions, because BizTalk assemblies need to be deployed into the GAC. What normally happens, is that if you have User Account Control (UAC) activated, or sometimes even deactivated, there are some additional securities setting present in recent Windows Server versions that, by default, doesn’t run Visual Studio with elevated permissions. The quick solution is for you to run Visual Studio as an Administrator by simply run below step:
  • Right-click under Visual Studio and choose “Run as administrator” option.
Visual Studio: Run as Administrator The problem with this approach is that you need to remember yourself to do it every time you want to run Visual Studio, otherwise the next time you try to deploy the solution it will fail again with the same error.

How do I know if Visual Studio is running as administrator?

If you want to understand if Visual Studio runs as Administrator, you can follow the below steps:
  1. Open the Task Manager
  2. Navigate to the Details tab page
  3. Right-click the column headers and click Select Columns
  4. Selected the Elevated option
  5. elevated
  6. Click OK
  7. In the list, identify Visual Studio (devenv.exe)
  8. If for devenv.exe, Elevated is Yes then Visual Studio runs as Administrator

How do I make Visual Studio always run as administrator?

Actually, this problem can be simply addressed by:
  • Access the devenv.exe file on the file system, which is by default installed in: “C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE”
  • Right-click devenv.exe and select “Troubleshoot compatibility”
Visual Studio: troubleshoot compatibility
  • On the “Select troubleshooting option” page, select “Troubleshoot compatibility” option
Visual Studio: troubleshoot option
  • On the “What problems do you notice?” page, select the “The program requires additional permissions” option and then click “Next”
Visual Studio: requires additional permissions
  • On the “Test compatibility settings for the program” page, click “Test the program…”, wait for the program to launch and then click “Next”
  • Select “Yes, save these settings for this program”
Visual Studio: save settings
  • Click “Close”
You will never face this problem again… at least at that client. Enjoy and Stay tuned for new BizTalk Server Tips and Tricks!