I can specify the SkipPostSharp constant to ensure a project is excluded from the list of projects PS processes. I want to do it the other way around though. I want PS to assume it shouldn't process anything that I don't specifically tell it to.
Is this achievable?
There are three conditions for a project to be automatically processed by PostSharp:
The third condition is what becomes false when you disable PostSharp by checking the option in VS project properties.
You could disable PostSharp by default by setting the SkipPostSharp=True property by default. This can be achieved by creating a file named PostSharp.Custom.targets in one of the parent directories of your projects, with the following content:
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<SkipPostSharp Condition="'$(SkipPostSharp)'==''">True</SkipPostSharp>
</PropertyGroup>
</Project>
Then, in every project where PostSharp is actually needed, you would need to define the property SkipPostSharp=False. You will have to do that using a text editor, because the project property tab only allows to set the property to True or to undefine it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With