Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

msbuild.exe won't deliver the new output after file changed

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

  • List item
  • Window 7 64-bit version
  • MS Visual C++ 2010
  • The solution contains several sub-projects which deliver libary as output separately.

If anyone can help, I'll be very thankful.

like image 835
OISS Avatar asked Dec 20 '25 15:12

OISS


1 Answers

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"
like image 78
Michael Avatar answered Dec 23 '25 09:12

Michael



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!