Question

I've a Visual Studio project with a pre-build event that copies some dll under the output directory.

I would raise pre-build event whenever that I launch application with F5.

In other words, I would to force solution rebuild on each run. How can I do?

Était-ce utile?

La solution

You can force this behaviour by removing your Build-Directory before building.

<YourProject> -> RightClick -> Properties -> Build Events -> "Pre-build event command line" -> 

Add something like this here:

rmdir -s "$(ProjectDir)bin\"
rmdir -s "$(ProjectDir)obj\"

Hope this can help somebody, even if this Question is 7 years old now...

Autres conseils

Why would you need that? You only need to copy the DLL if it has changed.

Besides that, Visual Studio only builds when it has to, and only rebuilds completely if either it needs to or you tell it to. There is no way to force VS to rebuild if nothing has changed or if it can get away with just rebuilding a single project...

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top