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 / IDE / December 2004

Tip: Looking for answers? Try searching our database.

VSProject.References.Add and multiple versions

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Chris Simmons - 03 Dec 2004 15:02 GMT
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?

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.