I need to compile for visual studio project using MSBuild for .Net version 3.5. I have downloaded Visual studio 2013 which comes with a tool chain 12.0 which uses .Net version 4.5. I can't install Visual Studio 2008(which comes with .NET version 3.5) because that is not supported on my Windows 7 PC.
I am using following powershell script to do that:-
# set environment variables for Visual Studio Command Prompt
pushd 'c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC'
cmd /c "vcvarsall.bat&set" |
foreach {
if ($_ -match "=") {
$v = $_.split("="); set-item -force -path "ENV:\$($v[0])" -value "$($v[1])"
}
}
popd
write-host "`nVisual Studio 2010 Command Prompt variables set." -ForegroundColor Yellow
$ErrorActionPreference = "Stop"
write-host "** building busdog.sys" -ForegroundColor Yellow
Exec { MSBuild ./filter/busdog.sln /t:clean /ToolsVersion:3.5}
Exec { MSBuild ./filter/busdog.sln /p:Configuration="$conf_driver" /property:Platform="$platform" /ToolsVersion:3.5}
If I remove the "/ToolsVersion" setting from my MSBuild command above or set it to 12.0, then my code gets compiled perfectly.
But, with /ToolsVersion option set to 3.5, I keep getting following error:-
MSBUILD : error MSB3411: Could not load the Visual C++ component "VCBuild.exe". If the component is not installed, either 1) install the Microsoft Windows SDK for Windows Server 2008 and .NET Framework 3.5, or 2) install Microsoft Visual Studio 2008.[C:\workspace\busdog\filter\busdog.sln]
I already have .NET framework 3.5, 4.0 and 4.5 installed under: C:\Windows\Microsoft.NET\Framework\
Could someone please help with where I might be going wrong ?
Thanks Manas