我需要將'System.XML.dll'程序集引用添加到web.config中(爲了嘗試解決問題,請在此處提到:Problem with Extension method: IXmlLineInfo)。如何從web.config引用程序集?
我試着將下面一行添加到「組件」部分:
<add assembly="System.Xml, Version=2.0.5.0, Culture=neutral,
PublicKeyToken=7cec85d7bea7798e"/>
導致錯誤:
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: Could not load file or assembly 'System.Xml, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
說實話,我不知道,如果版本/文化/ PublicKeyToken指定正確。
我有幾個不同的版本system.xml.dll的的:
- C:\ Program Files文件(x86)的\參考大會\微軟\ Framework.NETFramework \ v3.5版本\資料\客戶端\ SYSTEM。 XML.dll
- C:\ Program Files(x86)\ Reference Assemblies \ Microsoft \ Framework.NETFramework \ v4.0 \ Profile \ Client \ System.XML.dll
- C:\ Program Files(x86)\ Reference大會\微軟\ Framework.NETFramework \ V4.0 \ system.xml.dll的
- C:\ Program Files文件(x86)的\參考大會\微軟\框架\西爾夫rlight \ 3.0 \ system.xml.dll的
- C:\ Program Files文件(x86)的\參考大會\微軟\框架\ Silverlight的\ V4.0 \ system.xml.dll的
我也有一些組件在GAC的框架,框架64,等等
問題1:
我需要哪個組件?
問題2:(過時)
如何確定確切的程序集的版本和公鑰?
P.S.有趣的事情,當我貼出的問題,我發現有一個「publickkeytoken」標籤已經和它包含答案問題2 :)
非常感謝!
您可以輕鬆地通過[加載它來確定.NET程序集的完整簽名。NET Reflector](http://i.imgur.com/7BYX7.png)。作爲替代,您可以通過從Visual Studio命令提示符調用`sn -T`來獲取公鑰標記。 –
2011-01-13 16:51:09