Why can't PowerShell create my .net solutions? ("file is being used by another process")

I wrote a PowerShell script to create several .net solutions one by one. It simply calls a few tfget calls (to get the latest), followed by devenv.exe calls (to create .sln files).

Here is the code:

tfget -item $SolutionPath -overwrite -recurse -ev +errors
...
$out = invoke-expression "devenv.com /rebuild debug $SolutionPath"

Almost every time I run the script, one of the solutions fails to build, and I get an error message from CSC.exe (?), Saying:

error CS1606: build failed; withdrawal cannot be signed. The process cannot access the file because it is being used by another process.

This happens despite the fact that I have closed all instances of Visual Studio that support these solutions, and I do not have any of them working on my machine.

, , . PowerShell, , .

? - .NET- PowerShell?

+5
3

invoke-expression. devenv.exe SLN (, , MSBuild.exe, ). , exes . PowerShell:

msbuild.exe "R:\Source\Foo.sln" /t:build /p:Configuration=Debug `
    /v:detailed 2>&1 | Out-String -stream -width 1024 > $DebugBuildLogFile

Out-String, 80 120 ( , script).

+14

, devenv . , .

:

$p = Start-Process -FilePath devenv -ArgumentList $solutionPath,"/Rebuild Debug" -PassThru
$null = $p.WaitForExit(-1)

.

+3

1684 1606 system.dll

step 1: Remove [ control panal-> Microsoft .NET Framework 3.5 SP1 and KB976769v2 under Microsoft .NET Framework 3.0 Service Pack 2]

step 2:  windows update-> express-> .NET versions 2.0 through 3.5 (KB951847) x86.

msbuild. .

0

All Articles