We are trying to implement a file reference setup for our assemblies that will eventually belong to the GAC. As these assemblies are constantly in flux until we agree they are sufficient for release we want to do the file references with the following requirements:
1) Not force the developer to have to add each assembly to their GAC on their local box every time a change is made to the assembly
2) Have a common place for the assemblies
3) Still be able to debug the assemblies
4) Ensure each developer has the current release of the assembly
5) Not have the assemblies copied to the release directory when a release build is built with in VS.
a. Having the files in the GAC and in each applications local directory could get confusing as to which one it is actually using, even though we all know how/what order .net loads the assemblies.
I’ve got most of the above figured out, the issue I’m having is with #5. I would like to find a way in VS to allow for the copy local flag to be changed depending on if we are doing a build for Debug or Release. Having to change this flag each time manually would leave room for error, as would having to delete the assemblies manually after the build.
Is there a way to change the copy local property when you change the build type in the drop down Or is there a different way to do what I want that I’ve not thought of using VS as the build client (I’m sure there is)
Thanks
Wayne

Changing the copy local value at build time
farscape-dev
By making this change you are making the behavior of CopyLocal more complicated than the IDE can handle. So if you want this behavior you become unhooked from the IDE CopyLocal dialog. The build will work correctly and do what you want but the IDE dialog will not behave as expected. You would need to institute a set of rules for your environment that work around that - one which is probably "don't use the IDE to change CopyLocal if you plan to check the project back in".
Thanks,
Vladimir
Magannahan Skjellifetti
This does what I wanted it to do, but (yes there is always one)
With project template I can get the copylocal variable to be created each time, so that's not a big deal. I see the following issues with this and am wondering if there is a clean way to fix them:
1) Copy local isn't updated in the properties window as you change from Debug to release
2) Changing copy local in the properites window overwrites the variable in the settings folder
3) You can change copy local in the properties folder
4) Each developer will be required to modify the project file manually.
Any input on how to prevent the above issues would be appreciated.
Thanks
Wayne
mccune68
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>
Thanks,
Vladimir