Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) while trying to deploy a BizTalk Solution from Visual Studio

Continuing with “Errors and Warnings, Causes and Solutions”, let’s talk today about a classic (and annoying) one:

“Error 87 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

Error 88 at Microsoft.BizTalk.Gac.Fusion.IAssemblyCache.InstallAssembly(AssemblyCacheInstallFlag flags, String manifestFilePath, IntPtr referenceData)

at Microsoft.BizTalk.Gac.Gac.InstallAssembly(String assemblyPathname, Boolean force)

at Microsoft.BizTalk.Deployment.BizTalkAssembly.GacInstall(String assemblyLocation)

at Microsoft.BizTalk.Deployment.BizTalkAssembly.PrivateDeploy(String server, String database, String assemblyPathname, String applicationName)

at Microsoft.BizTalk.Deployment.BizTalkAssembly.Deploy(Boolean redeploy, String server, String database, String assemblyPathname, String group, String applicationName, ApplicationLog log)

Error 89 Unspecified exception: “

Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))”

Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

Error 90 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

Error 91 Failed to add resource(s). Change requests failed for some resources. BizTalkAssemblyResourceManager failed to complete end type change request. Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

Error 93 Assembly “<name of the assembley>, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6d6ddb8f4f8e0e50” references the following assemblies that must be deployed before deploying this assembly:

Assembly “<name of the assembley>, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6d6ddb8f4f8e0e50

Error 94  Deploy operation failed.

“”

Assembly “<name of the assembley>, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6d6ddb8f4f8e0e50” references the following assemblies that must be deployed before deploying this assembly:

Assembly “<name of the assembley>, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6d6ddb8f4f8e0e50″”

HRESULT: 0x80070005 (E_ACCESSDENIED) Visual Studio BizTalk Solution Deploy Access denied

while trying to deploy from Visual Studio a BizTalk solution.

This is actually very common in the recent versions of BizTalk Server, special because some additional securities setting present in recent Windows Server versions.

Causes

There are several possible causes for you to get access denied errors when deploying BizTalk solutions directly from Visual Studio. Here are some of the most common causes that you need to take in consideration and check for:

  • You are not a local Administrator: make sure you have administrator rights on the BizTalk server, this is required because BizTalk assemblies need to be deployed into GAC;
  • You don’t have the right BizTalk privileges to deploy artifacts: Make sure the user account that is trying to deploy the Visual Studio BizTalk Solution is a member of:
    • BizTalk Server Administrators group
    • And also, member of SSO Administrators or SSO Affiliate Administrators group

This is required because BizTalk artifacts need to be “registered” in BizTalk databases and these memberships should grant you the required access to the databases;

  • Visual Studio BizTalk Deployment properties are incorrect: Visual Studio uses the setting present in the Deployment tab of each BizTalk project present in the visual studio solution to correctly deploy the artifacts (DLLs). You should verify that your deployment configurations are correct by right-clicking the project in Visual Studio, selecting “Properties” and then click the Deployment tab. The most important properties that you need to check should be “Configuration Database” and “Server”, validate if they are what you expect them to be, and you should also check the “Application Name” property. Check more about Deployment Properties here: How to Set Deployment Properties in Visual Studio;
  • You are not running Visual Studio as administrator: If you have UAC activate, 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. Again, this is required because BizTalk assemblies need to be deployed into GAC;
  • Some process is locking the files: in some situations, some other processes, other Visual Studios or BizTalk Host Instances, may have a lock on the file(s) you are trying to replace, in these cases, stopping or restarting these services before deploying the solution should help.

Solutions

In the causes section, I already described the basic steps to solved this error based on the situation you are in so I will not address in detail here all the possible solution. In my case, and I think that is the most common situation, was that, despite having disabled the UAC, I was running the Visual Studio without elevating permissions.

There are several ways to solve this problem (running Visual Studio with elevated permissions), the simple way, of course, is to:

  • On the Start screen, type Visual Studio.
  • Right-click under Visual Studio and choose “Run as administrator” option.
HRESULT: 0x80070005 (E_ACCESSDENIED) Visual Studio run as administrator Access denied

The problem with this approach is that I need to remember myself to do it whenever I want to run Visual Studio, otherwise, the next time it will fail again with the same error.

To resolve once and for all, you can opt for two approaches:

  • Option one:
    • Access to the devenv.exe file on the file system, for example: “C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE”
    • Right-click devenv.exe and select “Troubleshoot compatibility”.
HRESULT: 0x80070005 (E_ACCESSDENIED) Visual Studio Troubleshoot compatibility
  • On the “Select troubleshooting option” page, select “Troubleshoot compatibility” option.
HRESULT: 0x80070005 (E_ACCESSDENIED) Visual Studio Troubleshoot compatibility option
  • On the “What problems do you notice?” page, select the “The program requires additional permissions” option and then click “Next”
HRESULT: 0x80070005 (E_ACCESSDENIED) Visual Studio Troubleshoot compatibility problem notice
  • 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”
  • and then click “Close”
HRESULT: 0x80070005 (E_ACCESSDENIED) Visual Studio run as administrator advance properties
  • Back to the Visual Studio … Properties windows, click “OK”
Author: Sandro Pereira

Sandro Pereira lives in Portugal and works as a consultant at DevScope. In the past years, he has been working on implementing Integration scenarios both on-premises and cloud for various clients, each with different scenarios from a technical point of view, size, and criticality, using Microsoft Azure, Microsoft BizTalk Server and different technologies like AS2, EDI, RosettaNet, SAP, TIBCO etc. He is a regular blogger, international speaker, and technical reviewer of several BizTalk books all focused on Integration. He is also the author of the book “BizTalk Mapping Patterns & Best Practices”. He has been awarded MVP since 2011 for his contributions to the integration community.

Leave a Reply

Your email address will not be published. Required fields are marked *

BizTalk360
BizTalk Server

Over 500+ customers across
30+ countries depend on BizTalk360

Learn More
Serverless360
Azure

Manage and monitor serverless
components effortlessly

Learn More
Atomicscope
Business Users

Monitor your Business Activity in iPaaS
or Hybrid integration solutions

Learn More

Back to Top