I Created a Powershell script for deploying my web application following Scott Guthrie's example explained here Automate Everything (Building Real-World Cloud Apps with Azure) Which uses this MSBuild invocation to build and publish the web app
& "$env:windir\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe" $ProjectCsproj `
/p:VisualStudioVersion=12.0 `
/p:DeployOnBuild=true `
/p:PublishProfile=$PublishXmlFile `
/p:Password=$Password
As you can see this sample assumes .Net framework version 4.0.30319 and will fail for other versions (or in the future .Net installations)
Is there a way to run this MSBuild command without assuming any specific .Net version ?