Changing project properties programmatically

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Fred Chen

    #1

    Changing project properties programmatically

    Hi,

    I've created a custom component. I want one of the properties of my
    custom component to be the output file name which is found in project
    properties. I know that I can get this by writing a macro, but I
    would prefer doing this in my component's constructor.

    Currently I am trying to use ActiveSolutionP rojects in the EnvDTE
    object to obtain the active project but it always returns an empty
    object.

    Does anyone know how I can get the current project output file name
    without using a macro?

    Thanks,
    Fred
  • Gabriel Esparza-Romero [MSFT]

    #2
    RE: Changing project properties programmaticall y

    Hi Fred

    Is your component an AddIn? how are you getting the EnvDTE object?

    If you run the same code as a macro do you get an object back?

    Another way to get to the projects is by using the EnvDTE.Solution .Projects property.

    --------------------[color=blue]
    >From: fredchen8@yahoo .ca (Fred Chen)
    >Newsgroups: microsoft.publi c.vsnet.ide,mic rosoft.public.d otnet.general
    >Subject: Changing project properties programmaticall y
    >Date: 21 Jul 2003 14:33:02 -0700
    >Organization : http://groups.google.com/
    >Lines: 16
    >Message-ID: <f500314d.03072 11333.1b6ace44@ posting.google. com>
    >NNTP-Posting-Host: 199.93.176.11
    >Content-Type: text/plain; charset=ISO-8859-1
    >Content-Transfer-Encoding: 8bit
    >X-Trace: posting.google. com 1058823183 13945 127.0.0.1 (21 Jul 2003 21:33:03 GMT)
    >X-Complaints-To: groups-abuse@google.co m
    >NNTP-Posting-Date: 21 Jul 2003 21:33:03 GMT
    >Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!new sfeed00.sul.t-online.de!t-online.de!news-spur1.maxwell.s yr.edu!news.max well.syr.edu!sn-xit-03![/color]
    sn-xit-01!sn-xit-09!supernews.co m!postnews1.goo gle.com!not-for-mail[color=blue]
    >Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.genera l:101963 microsoft.publi c.vsnet.ide:708 7
    >X-Tomcat-NG: microsoft.publi c.dotnet.genera l
    >
    >Hi,
    >
    >I've created a custom component. I want one of the properties of my
    >custom component to be the output file name which is found in project
    >properties. I know that I can get this by writing a macro, but I
    >would prefer doing this in my component's constructor.
    >
    >Currently I am trying to use ActiveSolutionP rojects in the EnvDTE
    >object to obtain the active project but it always returns an empty
    >object.
    >
    >Does anyone know how I can get the current project output file name
    >without using a macro?
    >
    >Thanks,
    >Fred
    >[/color]

    --
    Gabriel Esparza-Romero, Visual C# Team
    This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at
    http://www.microsoft.com/info/cpyright.htm

    Comment

    • Gabriel Esparza-Romero [MSFT]

      #3
      RE: Changing project properties programmaticall y

      Hi Fred

      Is your component an AddIn? how are you getting the EnvDTE object?

      If you run the same code as a macro do you get an object back?

      Another way to get to the projects is by using the EnvDTE.Solution .Projects property.

      --------------------[color=blue]
      >From: fredchen8@yahoo .ca (Fred Chen)
      >Newsgroups: microsoft.publi c.vsnet.ide,mic rosoft.public.d otnet.general
      >Subject: Changing project properties programmaticall y
      >Date: 21 Jul 2003 14:33:02 -0700
      >Organization : http://groups.google.com/
      >Lines: 16
      >Message-ID: <f500314d.03072 11333.1b6ace44@ posting.google. com>
      >NNTP-Posting-Host: 199.93.176.11
      >Content-Type: text/plain; charset=ISO-8859-1
      >Content-Transfer-Encoding: 8bit
      >X-Trace: posting.google. com 1058823183 13945 127.0.0.1 (21 Jul 2003 21:33:03 GMT)
      >X-Complaints-To: groups-abuse@google.co m
      >NNTP-Posting-Date: 21 Jul 2003 21:33:03 GMT
      >Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!new sfeed00.sul.t-online.de!t-online.de!news-spur1.maxwell.s yr.edu!news.max well.syr.edu!sn-xit-03![/color]
      sn-xit-01!sn-xit-09!supernews.co m!postnews1.goo gle.com!not-for-mail[color=blue]
      >Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.genera l:101963 microsoft.publi c.vsnet.ide:708 7
      >X-Tomcat-NG: microsoft.publi c.dotnet.genera l
      >
      >Hi,
      >
      >I've created a custom component. I want one of the properties of my
      >custom component to be the output file name which is found in project
      >properties. I know that I can get this by writing a macro, but I
      >would prefer doing this in my component's constructor.
      >
      >Currently I am trying to use ActiveSolutionP rojects in the EnvDTE
      >object to obtain the active project but it always returns an empty
      >object.
      >
      >Does anyone know how I can get the current project output file name
      >without using a macro?
      >
      >Thanks,
      >Fred
      >[/color]

      --
      Gabriel Esparza-Romero, Visual C# Team
      This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at
      http://www.microsoft.com/info/cpyright.htm

      Comment

      Working...