Visual Studio “Clean & Rebuild” in one button?

2019-09-06 09:54发布

问题:

My solution i'm working on it's has some specialy. And sometime I need to Clean solution and after that Rebuild solution, if not the web application can not access. That why I made a bat file for that work and bind the bat file to a button in Visual Studio toolbar.

But with that way, visual studio just run the bat file, so it clean and rebuild just one solution I'm defined before in the bat file. What I want is a button which can clean and rebuild on solution OPENING, is made a combo of Clean and Rebuild commands of visual studio to just one button.

Is there a way for me?

I'm using Visual Studio 2013.

回答1:

As @Blorgbeard said,

What is Rebuild Solution?

Rebuild solution will clean and then build the solution from scratch, ignoring anything it’s done before. What it does is deletes all the assemblies, exe’s and referred files to compile again.

What is Clean Solution?

Clean Solution will delete all compiled files (i.e., EXE’s and DLL’s) from the bin/obj directory.

Rebuild means compile and link all source files regardless of whether they changed or not. Build is the normal thing to do and is faster. Sometimes the versions of project target components can get out of sync and rebuild is necessary to make the build successful. In practice, you never need to Clean.