I have this C# Visual Studio solution that implements a plugin architecture. When building a debug build, I want a couple of plugins to be compiled into the main application. When building a release build, I want these .cs-files to be left alone.
Is there a way I can specify different Build Actions for the plugin files for debug and release builds? I would like it to be set to “Compile” in a debug build and to “None” in a release build.
Since plug-ins are usually in separate assemblies, I would create a separate project for each and every plug-in.
For projects you can define whether to build in a configuration or not: In Visual Studio open the Configuration Manager (Menu Build). In the upper left combobox select the Release or Debug configuration and set the build checkboxes in the list ad libitum.
Edit: Otherwise you have to edit the
.csprojfile manually and add a condition attribute to the item you want to exclude: