Starting Powershell or the command line as an administrator during the build of Team Team Visual Studio

I am working on a project in which we delay signing assemblies. I need to use the strong name tool a couple of times during assembly to disable strong name checking and then fully sign the assemblies before packing them. I tried using the powershell step to disable validation, but it returned with this error:

Script:

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

Error:

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

So, I created a script that will run the first, but added the -elevated parameter. It didn’t matter.

I also tried using the command line step instead of powershell. This also returns the same error.

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

script rdp'd , . , , .

?

+4
1

:

script rdp'd , .

, . , . , , .

Windows, "". services.msc "VSO Agent()". , . : C:\Agent\Agent\VsoAgent.exe /ChangeWindowsServiceAccount Run

, , , Agent\VsoAgent.exe.

. :

+2

All Articles