Introduced member not found for project references

joseph.m.wrobel's Avatar


05 Mar, 2018 07:59 PM

I feel like this question must have been asked many times already, but I cannot find anything about it. Maybe I'm bad a searching or maybe it's such an obvious thing that nobody has asked. Anyway.
I have a project which is using aspects to introduce members on a type. I want to be able to reference this project from another project in the same solution using a project reference. But, of course, I see errors of missing members. It all compiles fine, but I still see the errors. I do understand that the members get introduced at compile time, so I don't know how the other project could possibly know the members "will" exist and not show the error. So, my question is this, are there any known ways of tricking Visual Studio (with Resharper) into seeing these introduced members before compilation? Are there any magical extension that are able to patch this up? Or maybe some compiler tricks?


  1. Support Staff 1 Posted by PostSharp Techn... on 06 Mar, 2018 10:25 AM

    PostSharp Technologies's Avatar

    Hello Joe,

    what you are experiencing is due to how syntax highlighting and error reporting works in Visual Studio, which parses source in the background. As you mention, PostSharp is run during compilation and not as a part of compiler.

    For this reason, we prefer not to introduce members that are consumed by other projects in the same solution. Introduced members are usually used for communication between aspects and for libraries which reflect the compiled code at runtime.

    The preferred way to "extend" existing classes is to use Interface introduction in combination with an extension method, which detects the interface and calls interface method which would be otherwise introduced as a member.

    Could you please describe your use case of member introductions so that we can try to find better solution for you and for our future reference and documentation improvement?


    Best regards,

  2. 2 Posted by joseph.m.wrobel on 06 Mar, 2018 05:38 PM

    joseph.m.wrobel's Avatar

    Your response is satisfactory. I will take your advise and I know what to do. Thank You!

  3. Support Staff 3 Posted by PostSharp Techn... on 14 Mar, 2018 03:41 PM

    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 14 Mar, 2018 03:41 PM.

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