关于程序集的引用MSDN上有详细的描述 (原文地址:http://msdn.microsoft.com/en-us/library/wkze6zky(v=vs.80).aspx )
下面只说如何让程序集出现在.net的tab页中。
如下是上面链接的摘录:
Set a registry key that specifies the location of assemblies to display:
Add one of the following registry keys, where <AssemblyLocation> is the directory of the assemblies that you want to appear in the Add Reference dialog box, for example, C:\MyAssemblies\.
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\.NETFramework\<version>\AssemblyFoldersEx\MyAssemblies]@="<AssemblyLocation>"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\<version>\AssemblyFoldersEx\MyAssemblies]@="<AssemblyLocation>"
Creating the registry key under the HKEY_LOCAL_MACHINE node allows all users to see the assemblies in the specified location in the Add Reference dialog box. Creating the registry key under the HKEY_CURRENT_USER node only affects the setting for the current user. |
Invoke the Add Reference dialog box again; the assemblies should appear on the .NET tab. If they do not, ensure that the assemblies exist in the specified <AssemblyLocation>directory, then restart Visual Studio and try again.
批处理可以这样写(批处理文件和需要引用的程序集放在一个目录下)
set CURRENT_DIR=%cd%
reg add "HKLM\SOFTWARE\Microsoft\.NETFramework\v2.0.50727\AssemblyFoldersEx\Enterprise Library4.1" /ve /d %CURRENT_DIR% /f