locked
Resolving project references in VS package RRS feed

  • Question

  • I am implementing a VS Package using MPF. I am implementing a flavored project factory, and a custom editor in it. I have a couple of questions:

     

    1.      1.  From the references of my project which are .net project references, how to get hold of assembly specific information when the referenced project might not have been built? I want to generate intellisense in my custom editor based on the project references (the way c# editor does). How to go about it? Would it involve diving into the referenced project and parsing the source code in there, or are there any other easier methods?

               2.  In my VS package, I am implementing a flavored project factory (csharp flavored). How to intercept the ‘Add/Remove references’ events?

     

         Thanks,

         Rahul.

     

    Wednesday, November 24, 2010 8:32 AM

Answers

  • Hi Rahul,

    1. If you obtain the VSLangProj.VSProject object for you project, you can get the References collection. Each Reference object contains a SourceProject property that is set if it is a Project reference. From the Project you can get the CodeModel property to get information about types and their members defined in the project.

    2. Again, if you obtain the VSLangProj.VSProject, from there you can the VSProjectEvents.ReferencesEvents which allows you to get notifications for add/remove references.

    Lance

    Monday, November 29, 2010 9:26 PM

All replies

  • Hi Rahul,

     

    Welcome to MSDN forums! Thank you for your question.

    We’re doing research on this issue. It might take some time before we get back to you.

     

    Best Regards,

    Ziwei Chen

     

     


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Monday, November 29, 2010 2:53 AM
  • Hi Rahul,

    1. If you obtain the VSLangProj.VSProject object for you project, you can get the References collection. Each Reference object contains a SourceProject property that is set if it is a Project reference. From the Project you can get the CodeModel property to get information about types and their members defined in the project.

    2. Again, if you obtain the VSLangProj.VSProject, from there you can the VSProjectEvents.ReferencesEvents which allows you to get notifications for add/remove references.

    Lance

    Monday, November 29, 2010 9:26 PM