A project in the solution is a Windows Service that is used to remove events from the message queue and send notification emails;
The UI is an MVC site, and two project references the same class library, which references third-party generated PDF component Pechkin;
Every time I build a website, Pechkin's 7 DLLs are automatically copied to the Bin directory, 7 DLLs add up to 30 megabytes, and the Web site runs with an error (Modify IIS application pool can be resolved), every time I debug the site, To manually remove these DLLs from the bin directory is inefficient ,
In fact, only Windows Services project used to Pechkin, the site does not need, so I think of the VS generation event, under the build event through the macro command to automatically delete these DLLs, I did this
Right-click property on site = "Generate Event
$ (TargetDir) is the output directory, is the site's Bin directory, more command parameters can be clicked "Macros";
If EXIST to determine whether there is a file, a conditional judgment statement, do not change line;
DEL is to delete one or more files.
if EXIST $ (TargetDir) Pechkin.dll del $ (TargetDir) Pechkin.dll IF EXIST $ (TargetDir) Pechkin.Synchronized.dll DEL $ ( TargetDir) Pechkin.Synchronized.dll if EXIST $ (TargetDir) Libeay32.dll DEL $ (TargetDir) Libeay32.dll if EXIST $ (TargetDir ) libgcc_s_dw2-1. dll DEL $ (TargetDir) libgcc_s_dw2-1.DLL IF EXIST $ (TargetDir) Mingwm10.dll DEL $ (TargetDir) Mingwm10.dll if EXIST $ (TargetDir) Ssleay32.dll DEL $ (TargetDir) Ssleay32.dll if EXIST $ (TargetDir) Wkhtmltox0.dll DEL $ (TargetDir) Wkhtmltox0.dll
for more commands, refer to this website http://www.lxway.com/486410602.htm
VS2013 generating events, removing unnecessary DLLs