2010-01-07 37 views
0

我的ASP.NET應用程序使用某些第三個程序集。我有什麼選擇使應用程序加載該程序集?我必須將其放入GAC嗎? 我不想修改本機的PATH環境變量...指定程序集的位置到II

回答

0

你可以把它放到你的應用程序文件夾(最佳解決方案),或在你的web配置在this msdn entry像解釋添加一個代碼庫標籤:

<configuration> 
<runtime> 
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> 
    <dependentAssembly> 
     <assemblyIdentity name="MyAssembly2" culture="neutral" publicKeyToken="307041694a995978"/> 
     <codeBase version="1.0.1524.23149" href="FILE://C:/Myassemblies/MyAssembly2.dll"/> 
    </dependentAssembly> 
    </assemblyBinding> 
</runtime> 
</configuration> 

僅當您想共享該程序集時纔將其添加到GAC。

0

你的程序集是否被強名?

您可以把它放在GAC或你的web.config中引用它(使用<codeBase>元素根據這個MSDN article.

如果沒有

大會有權住在bin您的網絡應用程序的文件夾。