2016-04-11 13 views
4

私は、プロジェクトへの署名を延期しています。ビルド時に強力な名前ツールを数回使用し、厳密な名前検証を無効にし、アセンブリをパッケージ化する前に完全に署名する必要があります。私は、検証をオフにするPowerShellのステップを使用しようとしましたが、それは、このエラーで戻ってきた:Visual Studio Team Servicesビルド中にPowershellまたはコマンドプロンプトを管理者として実行します。

スクリプト:

$testprojs = gci Project.*.dll -r 
$testprojs | % { 
      sn -Vr $_ 
      write-output $("Turned off sn verification for " + $_.Name) 
} 

がエラー:

Failed to open registry key -- Administrator permissions are needed to use 
the selected options. Use an administrator command prompt to complete these tasks. 

だから私は実行するスクリプトを作成しました最初のものですが、-elevatedパラメータを追加しました。これは何の違いもありませんでした。

また、powershellの代わりにコマンドプロンプトの手順を使用してみました。これも同じエラーを返しました。

For /r %g in ("Project.*.dll") DO sn -Vr %g 

ビルドエージェントマシン自体にこの同じスクリプトrdpを実行しようとすると、意図したとおりに動作します。ビルドのステップとして実行されるのは、それが機能しない場合だけです。

アイデア?あなたの説明によると

答えて

2

When I tried running this same script rdp'd to the build agent machine itself, it works as intended.

私は、あなたが、ビルドのために独自のビルドエージェントを使用していると仮定します。これは、ビルドエージェントが管理者アカウントで実行されていないことが原因です。管理者アカウントで実行するようにビルドエージェントを更新してから、もう一度お試しください。

Run the agent Run as a service

If you deployed the agent to run as a Windows service, then the agent running status can be controlled from the Services snap-in. Run services.msc and look for "VSO Agent()". If you need to change the logon account, don't do it from the services snap-in. Instead, From an elevated Command Prompt, run: C:\Agent\Agent\VsoAgent.exe /ChangeWindowsServiceAccount Run interactively

Otherwise if you installed the agent to run interactively, the agent can be started by launching Agent\VsoAgent.exe.

詳細については、このリンクを参照してください:Run the agent

+0

これでした!はい、それは私たち自身のビルドエージェントです。サービスが実行されていたアカウントに管理者権限がないことに気づいていませんでした。乾杯 –

関連する問題