Tuesday 1 November 2011

PowerShell, MSBuild and 64-bit platforms

If you call PowerShell from MSBuild on a 64-bit platform, you will often get unexpected errors. One such error is as follows:

No snap-ins have been registered for windows powershell version 2

The probable cause is that the MSBuild executable you are running is not 64-bit. On 64-bit platforms you should execute MSBuild from the following location:

%SystemDrive%\Windows\Microsoft.NET\Framework64\v4.0.30319\msbuild.exe

Depending on how/what you have installed, your Start Menu shortcuts might be pointing to the 32-bit version.


0 comments:

About Me