In developing some addin projects, the output assembly is hosed by another process, and sometimes, after code editing, you wish to recomplile the code and run it again. Unfortunately, you are not always lucky enough.
You may see such errors like below shown:
Error 64 Unable to copy file "xxxAddin.dll" to "xxxAddin.dll". The process cannot access the file ‘xxxAddin.dll’ because it is being used by another process.
You can then turn to Task Manager, find the process, and then kill it, and then recompile in Visual Studio.
An easy way is to automate this is to use “External Tools” in Visual Studio:
The one labelled with A are the build-in external tools facilitated with VS. and the one with B is developed by ourselves. We can also put this custom tools inside a toolbar.
In VS, Tools>Customize, drag the external tools “N” to an existing toolbar.
You can customize the icon image as well by right clicking the toolbar item.
Now, let us finally program a console application: