Hello:
I am using the VSProject.References.Add method to add a reference to a
newly created project (in the default.js in a Wizard). My issue is
that I do not understand how VS.NET choose which version of a given
assembly to use. Here's the scenario:
1. I add a key with the path to v1 of my assembly to:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.1\AssemblyFolders
2. I create a new project using a custom wizard which uses
VSProject.References.Add( "myassembly" );
3. All goes as expected and the reference in the new project is
created.
4. I add a key with the path to v2 of my assembly to:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.1\AssemblyFolders
5. I create a new project using a custom wizard which uses
VSProject.References.Add( "myassembly" ); (same as step 2)
6. This project references v1 of my assembly.
My question is why would it reference v1? I guess I don't have a
problem with this if the first version the system encounters is added,
however I'd like to be able to add a reference to a specific version,
however I do not see an overload to Add() to allow this. Can someone
help?

Signature
Thanks,
Chris Simmons
newsgroup.replies@netchris.com
Carlos J. Quintero [.NET MVP] - 10 Dec 2004 09:47 GMT
- References.Add() receives as parameter the full path of the referenced
assembly.
- The referenced assembly is copied to the to project output folder unless
the same (strong named) assembly is in the GAC.
- You can?t add references to assemblies in the GAC
- I suppose that if you don?t specify a full path in the Add method, VS.NET
picks the first thing that it finds...

Signature
Carlos J. Quintero
The MZ-Tools all-in-one add-in, now for .NET: http://www.mztools.com
> Hello:
>
[quoted text clipped - 21 lines]
> however I do not see an overload to Add() to allow this. Can someone
> help?