knaki02
knaki02

Reputation: 183

How to get DEVPATH assemblies in the Add reference window in Visual Studio 2010?

I want to add reference to an assembly that is in the Devpath folder. But it does not appear in the Add Reference Window.

the C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.config is updated with :

<runtime>
    <developmentMode developerInstallation="true"/>
</runtime>

The environment variable DEVPATH is set in system variable as
C:\SharedAssemblies

I try to add the reference directly into the project file :

<Reference Include="AssemblyName, Version=1.0.0.0, Culture=neutral, PublicKeyToken=123456789, processorArchitecture=MSIL">

But MSBuild do not look at the devpath folder and returns

warning MSB3245: Could not resolve this reference. Could not locate the assembly...

How does this work ?


If I add the assembly to the GAC, the Fusion log show me that the devpath folder is used :

*** Entrée du journal Binder d'assembly  (28/11/2012 @ 15:09:07) ***

L'opération a réussi.
Résultat de liaison : hr = 0x0. L’opération a réussi.

Gestionnaire des assemblys chargé à partir de :  C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll
Exécution sous l'exécutable  c:\users\User\documents\visual studio 2010\Projects\ConsoleApplication1\ConsoleApplication1\bin\Debug\ConsoleApplication1.vshost.exe
--- Un journal des erreurs détaillé suit. 

=== Informations d'état de liaison préalable ===
JRN : utilisateur = User
JRN : DisplayName = AssemblyName, Version=1.0.0.0, Culture=neutral, PublicKeyToken=123456789
 (Fully-specified)
JRN : Appbase = file:///c:/users/User/documents/visual studio 2010/Projects/ConsoleApplication1/ConsoleApplication1/bin/Debug/
JRN : DEVPATH = C:\SharedAssemblies
JRN : PrivatePath initial = NULL
JRN : base dynamique = NULL
JRN : base de cache = NULL
JRN : AppName = NULL
Assembly appelant : Microsoft.VisualStudio.HostingProcess.Utilities, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.
===
JRN : cette liaison démarre dans le contexte de chargement de default.
JRN : utilisation du fichier de configuration de l'application : c:\users\User\documents\visual studio 2010\Projects\ConsoleApplication1\ConsoleApplication1\bin\Debug\ConsoleApplication1.vshost.exe.Config
JRN : utilisation du fichier de configuration de l'ordinateur à partir de C:\Windows\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
JRN : référence post-stratégie : AssemblyName, Version=1.0.0.0, Culture=neutral, PublicKeyToken=123456789
JRN : un assembly a été trouvé dans le chemin d'accès DEVOVERRIDE C:\SharedAssemblies\AssemblyName.DLL

Upvotes: 0

Views: 1329

Answers (1)

knaki02
knaki02

Reputation: 183

Adding the registry key

[HKEY_CURRENT_USER\SOFTWARE\Microsoft\.NETFramework\v2.0.50727\AssemblyFoldersEx\DEVPATH]@="C:\SharedAssemblies"

does the job.

MSDN reference

Upvotes: 1

Related Questions