I want to build my solution file using MSBuild but there is one issue. My MSBuild file is located at C:\WINDOWS\Microsoft.NET\Framework\v3.5\. So now only if I have my entire solution and projects files in this path am I able to compile the solution. But I cant keep having all my solution and project files in C:\WINDOWS\Microsoft.NET\Framework\v3.5\. The location of my solution files maybe at any location in my pc or in TFS, and I’ll have to use MSBuild to compile it.
I saw in some forum that I’ll have to change the path in regedit in the location
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\3.5, but then it still remains static. If I want to execute a solution file which is in TFS then I’ll have to again change the path in regedit.
Is there any alternative to this?
The msbuild.exe is there on my system, too. That is perfectly fine, as it’s the task of VS or build tools to handle that. Normally you would either run a build script with
C:\WINDOWS\Microsoft.NET\Framework\v3.5\in the path environment, or your build solution knows where to find it. Usually, the msbuild.exe has to be changed only when you retarget to a different framework version (say 4.0). For building on a clean machine, the prerequisites should be set up correctly. So there should be no need to include msbuild.exe in your repository. Probably this would be considered bad practice. Do you have any reason, why you want to have the msbuild.exe versioned?