visual-studio-2010visual-studiobuildrebuildpre-build-event

Visual Studio: rebuild solution on each run...how?


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?


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...