locked
How can I retrieve VSLangProj.ProjectProperties for project ? RRS feed

  • Question

  • How can I retrieve VSLangProj.ProjectProperties for project ?
    Wednesday, May 5, 2010 2:37 PM

Answers

  • Hi,

    Do you mean the properties which are stored in the project file like 'OutputPath' or 'RootNamespace'.

    there are two categories of them:
    the Configuration dependent ones and the others (configuration like 'Debug' or 'Release')

    If yes: you can use the EnvDTE.Project to do so.

    To get the EnvDTE.Project from VsProject you can use the VSProject.Project property.

    Configuration dependent properties are in EnvDTE.Project.ConfigurationManager.ActiveConfiguration.Properties

    non Configuration dependent properties are in EnvDTE.Project.Properties

    To get an Property value use:
    ...Property.Item
    ("OutputPath").Value

    You can also search for "Accessing Project Type Specific Project, Project Item, and Configuration Properties" in SDK docs.

    Hope this helps,
    Reinhard.

    Wednesday, May 5, 2010 3:17 PM

All replies

  • Hi,

    Do you mean the properties which are stored in the project file like 'OutputPath' or 'RootNamespace'.

    there are two categories of them:
    the Configuration dependent ones and the others (configuration like 'Debug' or 'Release')

    If yes: you can use the EnvDTE.Project to do so.

    To get the EnvDTE.Project from VsProject you can use the VSProject.Project property.

    Configuration dependent properties are in EnvDTE.Project.ConfigurationManager.ActiveConfiguration.Properties

    non Configuration dependent properties are in EnvDTE.Project.Properties

    To get an Property value use:
    ...Property.Item
    ("OutputPath").Value

    You can also search for "Accessing Project Type Specific Project, Project Item, and Configuration Properties" in SDK docs.

    Hope this helps,
    Reinhard.

    Wednesday, May 5, 2010 3:17 PM
  • Hi AlexNG2,

    Just additional information, we can access ProjectProperties through Properties collection by supplying the name of the property for the specific type of project as a string to specify the Property. For more information, please see:

    How to Access Properties of Specific Project Types

    Best Regards,

    Nancy


    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.
    Tuesday, May 18, 2010 6:26 AM