<2017 December>
SunMonTueWedThuFriSat
262728293012
3456789
10111213141516
17181920212223
24252627282930
31123456

On this page...

Search

Links

Member of...


ASP Insiders

MVP Visual Developer ASP/ASP.NET

Enter CodeZone

Blog Categories

Microsoft

Blogroll

Deutsche Resourcen

Management

Sign In
 

#  Friday, 09 June 2006

When working with a team, it is always a good idea to have dependencies in a separate folder so everyone can reference them using relative paths:

References from this dependencies folder then look as follows in the MyWinApp.csproj file:

  <ItemGroup>
    <Reference Include="Boo.Lang, Version=1.0.0.0, ...">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\Dependencies\\Boo.Lang.dll</HintPath>
    </Reference>
...
    <Reference Include="System" />
...
    <Reference Include="System.Xml" />
  </ItemGroup>

So every team member that checks out the project will be able to work in their workspace, as well as the build server will have all the proper references. Great.

But what about the following scenario: depending on Release or Debug, you need different references - how can you solve this problem? The first step is to go and create a directory for each configuration below the Dependencies folder:

Next, copy the assemblies to the respective directories. Plus, you have to modify the .csproj file and add $(Configuration) to the external reference's hint path:

  <ItemGroup>
    <Reference Include="Boo.Lang, Version=1.0.0.0, ...">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\Dependencies\$(Configuration)\\Boo.Lang.dll</HintPath>
    </Reference>

That's it - even Visual Studio will honor this change and still provide you with IntelliSense.

Before closing, I want to mention a new tool - even though it doesn't (yet) support editing the hint path, you should check out Attrice's Microsoft Build Sidekick. It allows you to graphically edit .*proj files:

Categories: .NET | Cool Download | Visual Studio
Friday, 09 June 2006 08:07:18 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]Tracked by:
"Web Deployment Project, MSBuild, and WAP Resources" (Eli Robillard's World of B... [Trackback]

 



© Copyright 2017 Christoph Wille

newtelligence dasBlog 2.3.9074.18820
Subscribe to this weblog's RSS feed with SharpReader, Radio Userland, NewsGator or any other aggregator listening on port 5335 by clicking this button.   RSS 2.0|Atom 1.0  Send mail to the author(s)

 
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.