views:

104

answers:

2

How does the Visual studio populate the references tab?

By using something like currentDomain.GetAssemblies() or what?

A: 

Visual Studio will search for all assemblies in the "reference paths".

Reference paths can be defined per-project using a project property; but they can also be set in the registry. Take a look at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\AssemblyFolders.

Daniel
A: 

Which references "tab" are you referring to? The Add Reference dialog has a tab for .NET , COM, and Projects (plus the Browse and Recent tabs, which you probably aren't interested in.

The most obvious one is Projects, which simply shows you the projects in your solution that aren't already added as a reference to the current project.

For COM, it looks at all of the COM components which have registered TypeLibs from HKEY_CLASSES_ROOT\TypeLib.

The .NET tab uses the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\AssemblyFolders registry key for the list of folder paths. It also looks at %ProgramFiles%\Microsoft Visual Studio 9.0\Common7\IDE\PublicAssemblies or %ProgramFiles%\Microsoft Visual Studio 8\Common7\IDE\PublicAssemblies (again, depending on the version). If you have VS2008 installed, you can also add additional paths per project in the "Reference Paths" tab of the project properties.

Scott Dorman
I seem to have lots of assemblies that do not fit in the list above. I wonder where they could be...
Dmitri Nesteruk