Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / Extensibility / March 2006

Tip: Looking for answers? Try searching our database.

Project manipulation from an add in

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Wayne Sepega - 21 Mar 2006 12:34 GMT
I need to change the value of Copy local based on the active configuration,
below is the solution I was given to do this, but it requires I manually
edit the project file.

This is where the add in comes into play, I am able to get the list of
references and such from the project object, so I've got it started at
least. However, I'm having trouble with the following:

1) How to add the CopyLocal to the property Configuration once I have the
config (know how to get that)

2) How to retrieve the CopyLocal from the Configuration (probably will be
obvious once item 1 is working)

3) How to set the Private property to $(CopyLocal) once the configs have the
value all set up

4) How to know that private is set to $(CopyLocal) vs. True/False.

Thanks
Wayne

You can conditionally set a property on a basis of current configuration:
Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "

At the top of your *.csproj or *.vbproj you'll find a per configuration
section, so you can just add a new property to that section:

 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' ==
'Debug|AnyCPU' ">

   <CopyLocal>true</CopyLocal>

 </PropertyGroup>

Using this you set the Private attribute on the references on the basis of
the current configuration. If the private attribute is true the "CopyLocal"
is set to true.

   <ProjectReference Include="..\MyProj.csproj">
     <Project>{A4E9A2C2-....}</Project>
     <Private>$(CopyLocal)</Private>
   </ProjectReference>
Carlos J. Quintero [VB MVP] - 21 Mar 2006 16:28 GMT
I answered in the Microsoft forum for Visual Studio 2005 extensibility.

http://forums.microsoft.com/msdn/showforum.aspx?forumid=57&siteid=1

Signature

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio
You can code, design and document much faster:
http://www.mztools.com

> I need to change the value of Copy local based on the active
> configuration, below is the solution I was given to do this, but it
[quoted text clipped - 39 lines]
>      <Private>$(CopyLocal)</Private>
>    </ProjectReference>
Wayne Sepega - 21 Mar 2006 19:07 GMT
Saw that, I also replied to your reply there as well :)

Wayne

>I answered in the Microsoft forum for Visual Studio 2005 extensibility.
>
[quoted text clipped - 43 lines]
>>      <Private>$(CopyLocal)</Private>
>>    </ProjectReference>

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.