Is it necessary to add references to PostSharp in projects that may inheirit clases from other projects that do use it

dom's Avatar


25 Oct, 2017 08:36 AM


Apologies fore what is probably a really stupid question as I begin to explore the potential of PostSharp. To date I have kept my experimentation to simple single project examples as I explore what PostSharp can do, now I want to broaden my horizons.

So I have a solution containing (at present) four projects. Project A contains a very simple base class for entity models that uses the [NotifyPropertyChanged] attribute. Projects B,C and D have entity definition classes that all reference the base class in project A. The aim is to see how PostSharp will remove a lot of the boiler plate code that ends up in a typical MVVM WPF application. I've yet to add views and viewmodels (although I do envisage a viewmodel base class in Project A decorated with [NotifyPropertyChanged] ) so at present I'm just stubbing out entity classes that I'll use with EF Code First.

Given that the solution builds perfectly well I'm assuming that adding additional references to the other projects is not necessary (unless I were to add other post sharp features not covered by the PostSharp dll's currently added to Project A. Am I correct in my assumptions?


  1. Support Staff 1 Posted by PostSharp Techn... on 25 Oct, 2017 06:26 PM

    PostSharp Technologies's Avatar


    you can add [NotifyPropertyChanged] aspect to your base class and PostSharp implements INPC for derived class automatically. But the necessary requirement is that PostSharp processes all projects containing your derived classes. It means that you have to install PostSharp.Patterns.Model nuget package to projects B, C, D as well.

    Best regards,

  2. 2 Posted by dom on 25 Oct, 2017 06:47 PM

    dom's Avatar

    Many thanks for the clarification Jakub, much appreciated.


  3. Support Staff 3 Posted by PostSharp Techn... on 26 Oct, 2017 08:24 AM

    PostSharp Technologies's Avatar


    We are going to close this request as we believe it was solved. Please feel free to reopen the discussion if you need more help.

    Best regards,
    PostSharp team

  4. PostSharp Technologies closed this discussion on 26 Oct, 2017 08:24 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac