Search code examples
postsharp

Disable Postsharp in debug builds for entire solution


I have a solution with many projects and I would like to disable Postsharp for debug builds to reduce local developer build times. Is there any way to do this without editing each project file?

I know this may sound like a bad idea, but we are only using Postsharp for exception logging and our builds go through several environments for automated/manual testing (which would use a release build), so we would pick up on any potential issues at this point.

If it helps, Postsharp was added to the projects via nuget.


Solution

  • You can define the compilation symbol (constant) "SkipPostSharp" for Debug mode only.