Minimum impact on code
2 posts • Page 1 of 1
Minimum impact on code
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
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
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
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.
got good support? consider donating to the project.
- gfraiteur
- Site Admin
- Posts: 694
- Joined: Tue Dec 18, 2007 3:09 pm
- Full Name: Gael Fraiteur
- Company: postsharp.org
2 posts • Page 1 of 1