问题描述
我正在创建一个 Azure 构建管道,我在其中使用 powershell 和 MSBuild 扩展来创建构建。我的项目在 msbuild 中有多个解决方案和步骤。当我从系统运行 powershell 时,我能够成功创建构建,但是当我使用 Azure 管道做同样的事情时,我遇到了如下权限问题。
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):错误 MSB8011:无法注册输出。请尝试启用每用户重定向或使用提升的权限从命令提示符注册组件。 [C:\Agent_work\1\s\2021-04-16 17-34-14\BHMessage\FNSKMSCache\FNSKMSCache.vcxproj]
此外,我正在使用 VS 2013,并且能够在 Visual Studio 中手动构建解决方案。请不要建议去项目属性并执行此操作。我已授予对注册表的所有访问权限,并且 Visual Studio 也已使用管理员帐户登录,谁能告诉我出了什么问题以及如何解决此问题?