Minimum impact on code

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

Minimum impact on code

Postby markusmes on Tue Mar 04, 2008 8:01 pm

Hi,

what is the minimum change to do in my code to add an aspect to it by a build script ?

E.g. I have a MyAssembly.dll and want postbuild it by PostSharp.exe.
The postbuild does following:

PostSharp.exe Default.psproj MyAssembly.dll /p:Output=MyAssembly_PS.dll /p:IntermediateDirectory=.\temp /p:CleanIntermediate=false

My current knowledge is that I must reference PostSharp.Public.dll and PostSharp.Laos.dll in original MyAssembly.dll. And I must reference my special aspect dll with the special subclass of OnMethodBoundaryAspect.

I want to serve my dll optionally with the aspect. So I would prefere a less dependency in my original dll (no references to aspect things). Is this possible ?

Thanks in advance
Markus
markusmes
 
Posts: 1
Joined: Tue Mar 04, 2008 7:33 pm
Full Name: Markus Messerschmidt

Re: Minimum impact on code

Postby gfraiteur on Wed Mar 05, 2008 11:15 am

This is not possible to avoid shipping your aspect library using Laos, since the aspected code actually reference your aspect.

If this is critical for you (and if you are rich in free time), you can program your aspect using PostSharp Core and avoid any reference (since you can inject individual instructions). This is quite hard, however (it will take you probably 2 weeks).

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


Return to Integration with IDE and Build Scripts