Disable postsharp build task for a project?

Questions about integration in Visual Studio, MSBuild or other IDEs or build tools.

Disable postsharp build task for a project?

Postby mschmidt on Sat Feb 16, 2008 7:04 pm

(First, I want to thank Gael for this great project. The possibilities are amazing, although I only scratched the surface for now...)

In my current project, I use PostSharp/Laos to implement the INotifyPropertyChanged interface to my domain objects (which becomes even more elegant in combination with automatic properites in C# 3.0). As the assembly with my domain objects is referenced by a number of other assemblies, I have to add a reference to PostSharp.Public and PostSharp.Laos for these assemblies, too.

"Infecting" these assemblies with PostSharp where I don't explicitly use it is okay for me, but it triggers the PostSharp build action for all these assemblies. It's worth it to wait a few seconds for building an assembly when it saves a lot of code, however a few seconds for each assembly where I don't use it directly results in a considerably slower build in my case.

My question is, if there is any way to tell PostSharp to skip its post-compile task on a project, e. g. by setting a property in the project file, adding an attribute to AssemblyInfo, adding a compiler symbol or anything like that.

Thank you very much in advance!
mschmidt
 
Posts: 2
Joined: Sat Feb 16, 2008 6:37 pm
Full Name: Markus Schmidt
Company: 2ZJ9J

Re: Disable postsharp build task for a project?

Postby gfraiteur on Sat Feb 16, 2008 7:25 pm

I have blogger about this recently.

The default behavior is to call PostSharp if the current project references (directly or indirectly) references PostSharp.Public.dll.

If you reference PostSharp.Public.dll but your project does not need to be postsharped, define the SkipPostSharp compilation symbol (or "constant") in your project.

Happy aspecting!

Gael
Gael Fraiteur, project leader
got good support? consider donating to the project.
gfraiteur
Site Admin
 
Posts: 674
Joined: Tue Dec 18, 2007 3:09 pm
Full Name: Gael Fraiteur
Company: postsharp.org

Re: Disable postsharp build task for a project?

Postby mschmidt on Sat Feb 16, 2008 9:23 pm

gfraiteur wrote:If you reference PostSharp.Public.dll but your project does not need to be postsharped, define the SkipPostSharp compilation symbol (or "constant") in your project.


Thank you very much, works great! No idea why I missed that...

By the way, I wish some commercial tool vendors would offer such great support, even on a weekend :D
mschmidt
 
Posts: 2
Joined: Sat Feb 16, 2008 6:37 pm
Full Name: Markus Schmidt
Company: 2ZJ9J


Return to Integration with IDE and Build Scripts