Reputation: 97
Recently I am facing a problem with msbuild.exe by building a dll. My idea is to call the msbuild from DOS command line to automatically create the DLL without opening MS Visual Studio. The command line (as example) I am using is:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe C:\example.sln /p:Configuration=example_config
The problem is, even I changed the files in this project (outside of MS Visual Studio), it seems that msbuild.exe isn't able to recognize the change and still output the old dll based on the old files.
Also I tried to delete the output DLL beforehand, but still the same result. The command line from DOS delivered the old dll.
If I open Visual Studio and build the output manually, the problem won't happen.
I checked around in web but can't find a feasible solution for this. Someone mentioned that it could be problem of MS. Actually, I was also not facing this problem under Windows XP.
I am using
If anyone can help, I'll be very thankful.
Upvotes: 3
Views: 537
Reputation: 1282
You can build your project by calling Visual Studio 2010 from the command line. To build without opening Visual Studio, call "devenv.com" (command-line-friendly Visual Studio executable) to build the project. More info regarding devenv command line usage can be found on MSDN.
Customize the following command and run it from the command prompt to build your project:
"%VS100COMNTOOLS%..\IDE\devenv.com" "full-path-to-solution" /Rebuild "desired-configuration" /Project "full-path-to-project"
Upvotes: 1