My current approach is to have the tests running as part of the build process on our TFS. This might not be helpful for all scenarios, but I've spent quite a while to find a solution that would allow me to run the unit tests of our business logic without any impacts of PostSharp.
I created two different build definitions, one of which has the MSBuild Arguments set to /p:SkipPostSharp=True
(this is the one running the unit tests) and the other one to False
respectively. Additionalliy, I set the Disable Tests
option to True
for the build definition using PostSharp.
I know this isn't ideal (especially because now I've got the problem of not being able to run the tests locally without any changes), but I couldn't find any other way around it. It seems that there aren't too many people with the same problems. As I'm an absolute newbie in terms of MSBuild and its configuration, maybe someone with a better knowledge could help.
I also played around with the Configuration Manager
in Visual Studio to create another build definition, but all my attempts only produced more problems than anything else.