I am creating a Azure build pipeline where I am using a powershell and MSBuild extension to create build. My project has multiple solutions and steps In msbuild. When I am running powershell from system I am able to create build successfully but when I am doing the same thing using Azure pipeline I am getting permission issues as below.
C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(4169,5): error MSB3216: Cannot register assembly "C:\Agent\_work\1\s\2021-04-16 17-34-14\BHMessage\RssiStatisticsStorage\bin\Release\RssiStatisticsStorage.dll" - access denied. Please make sure you're running the application as administrator. Access to the registry key 'HKEY_CLASSES_ROOT\FixedNet.Common.TimeUtilities' is denied. [C:\Agent\_work\1\s\2021-04-16 17-34-14\BHMessage\RssiStatisticsStorage\RssiStatisticsStorage.csproj]
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(1620,5): error MSB8011: Failed to register output. Please try enabling Per-user Redirection or register the component from a command prompt with elevated permissions. [C:\Agent_work\1\s\2021-04-16 17-34-14\BHMessage\FNSKMSCache\FNSKMSCache.vcxproj]
Also i am using VS 2013 and i am able to build solution manually in visual studio. Please don't suggest go to project properties and do this. I have given all access to registry and visual studio is also logged in with admin account, can anyone tell me what is wrong and how to fix this?
You could try to open the agent service, and change the Log On account to an Administrator: