And I was thinking that this only happened with BizTalk Server… Yesterday, I opened Visual Studio 2019 to modify and deploy a Logic App Consumption project to our DEV environment to test our changes and, later on, plan to deploy it to production. However, when I tried to deploy the solution through Visual Studio into our DEV environment, I got the following error:
Unable to copy file “E:\Source…\LA-Project-name\Deploy-AzureResourceGroup.ps1” to “bin\Debug\staging…\Deploy-AzureResourceGroup.ps1″. Access to the path ‘bin\Debug…\Deploy-AzureResourceGroup.ps1’ is denied.
Done building project “LA-Project-name-DEV.deployproj” — FAILED.
Build FAILED.
I was slightly surprised since my team has deployed the solution many times to the DEV environment without any issues.
Cause
With this error message, I quickly remembered my experience with BizTalk Server projects and an error that I had published quite a while ago: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) while trying to deploy a BizTalk Solution from Visual Studio.
To be honest, this behavior has become frequent with all security features implemented in the operating system, especially after Microsoft introduced User Account Control. This means that you run all programs as a standard user, even if you are an administrator. But there are many things that we need to do in Visual Studio that require us to run as an admin, not a standard user.
Solution
To solve this issue, you should run Visual Studio as an administrator. To do that, you need the following:
- Select the Start button, and then in the Search box, type Visual Studio.
- Next, right-click Visual Studio 2019 and select More > Run as administrator.
Open your BizTalk Visual Studio Solution and try to build and deploy it. It worked for me!
I hope you find this helpful! If you liked the content or found it helpful and want to help me write more content, you can buy (or help buy) my son a Star Wars Lego!