Leaky abstraction?

Do you program directly PostSharp.CodeModel or another low-level API and need help? Put your questions here and we will try to answer.

Leaky abstraction?

Postby akcoder on Wed Jan 09, 2008 12:51 am


I'm using PostSharp version 1.0.7.280.  I added a reference PostSharp.Core, Laos and Public to my DomainModel.

In my DomainModel, I have a class called Person.  On the Person class I added the EditableObject and NotifyPropertyChanged aspects from the PostSharp samples.

Everything in my DomainModel compiles and works just fine after adding these attributes.  However, now when I compile, the various projects of my solution which use my DomainModel now demand a reference to PostSharp.Laos.  To me, this seems like a very leaky abstraction.

Error from MSBuild:
The type 'PostSharp.Laos.IComposed`1<T0>' is defined in an assembly that is not referenced. You must add a reference to assembly 'PostSharp.Laos, Version=1.0.7.281, Culture=neutral, PublicKeyToken=b13fd38b8f9c99d7'.    C:\Projects\Personal Projects\NHibernate Demo\BusinessLogic\PersonManager.cs
The type 'PostSharp.Laos.IProtectedInterface`1<T0>' is defined in an assembly that is not referenced. You must add a reference to assembly 'PostSharp.Laos, Version=1.0.7.281, Culture=neutral, PublicKeyToken=b13fd38b8f9c99d7'.    C:\Projects\Personal Projects\NHibernate Demo\BusinessLogic\PersonManager.cs

Any help you have would be appreciated.

Thanks,
Dan
Dan Morphis
akcoder
 
Posts: 1
Joined: Sat Jan 12, 2008 4:55 pm
Full Name: Dan Morphis

Re: Leaky abstraction?

Postby gfraiteur on Wed Jan 09, 2008 9:46 am

Dan,

Your project using aspects should have references to PostSharp.Public.dll and PostSharp.Laos.dll.

If you use the composition aspect (which adds interfaces to types), you'll have to add PostSharp.Laos.dll (and maybe PostSharp.Public.dll) to all projects *referencing* aspected projects should have.

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


Return to PostSharp Core