Reputation: 429
I need to msbuild C# project of lower version on commandline, I donot have Visual Studios.
I am facing the error while building the project:
Microsoft (R) Build Engine Version 2.0.50727.42
[Microsoft .NET Framework, Version 2.0.50727.42]
Copyright (C) Microsoft Corporation 2005. All rights reserved.
.\Project.sln : Solution file error MSB4054: The solution file must be opened in t
he Visual Studio IDE and converted to the latest version before it can be built
by MSBuild.
I have the .sln file and previously someone did build the project from here possibly with the Version 1.0 engine.
Can someone help me with this?
Upvotes: 4
Views: 1230
Reputation: 429
Ok, got permission from client to install VStudios. Installed and built the program :/
Upvotes: 0
Reputation: 17751
In many cases you can just pass the project file to MsBuild and it will compile just fine. Forexample:
msbuild MyProj.csproj /p:Configuration=Release
.csproj files are valid MsBuild XML files whereas .sln files have to be converted into MsBuild scripts on the fly, which is why they are tied to a specific version of Visual Studio.
If you have multiple projects in your solution I would recommend passing the primary/startup project to MsBuild so that all of the dependencies also get built. This method does not always work and you may run into problems is if you have any solution level dependencies or custom solution configurations specified in the solution file.
Upvotes: 1
Reputation: 13081
You'll find MSBuild in C:\Windows\Microsoft.NET\Framework[framework version].
For instance, the one that came with .NET 2.0 is in C:\Windows\Microsoft.NET\Framework\v2.0.50727. I believe that's the one that came with VS 8.0.
If you need the x64 version, it's in C:\Windows\Microsoft.NET\Framework64\v2.0.50727
Upvotes: 1