如何在Visual Studio 2010的“添加引用”窗口中获取DEVPATH程序集? [英] How to get DEVPATH assemblies in the Add reference window in Visual Studio 2010?

查看:187
本文介绍了如何在Visual Studio 2010的“添加引用”窗口中获取DEVPATH程序集?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想添加对Devpath文件夹中的程序集的引用。但是它不会出现在添加引用窗口中。

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

C:\Windows\Microsoft.NET\Framework\v2.0.50727\ CONFIG\machine.config 更新为:

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

环境变量DEVPATH在系统变量中设置为

C :\SharedAssemblies

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">

但是MSBuild不要看devpath文件夹并返回

But MSBuild do not look at the devpath folder and returns


警告MSB3245:无法解析此引用。无法找到程序集...

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

这是如何工作的?

如果我将程序集添加到GAC,则Fusion日志会显示使用devpath文件夹:

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


推荐答案

添加注册表项

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

完成工作。

MSDN参考

这篇关于如何在Visual Studio 2010的“添加引用”窗口中获取DEVPATH程序集?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆