2014-02-13 26 views
0

所有的,我陷入了一個讓我瘋狂的問題...請幫助檢查它。提前致謝。如何在調試時在網站上找到錯誤的引用dll

我想引用一個NHibernate.dll到我的網站版本號2.1.0.4000。 但我不知道爲什麼當我嘗試調試它時,網站總是搜索版本號爲2.1.2.4000NHibernate.dll

enter image description here

這是我嘗試做。

  1. 嘗試使用fuslogvw來跟蹤程序集綁定。

enter image description here 你可以看到應用程序要綁定這不是我想要的版本2.1.2.4000

  • 除去在我的解決方案的Nhibernate所有參考。並再次添加正確的一個。

  • 去網站項目。我發現剛剛添加的dll在版本號列中顯示auto update,而不是參考對話框中的正確版本號。我不知道爲什麼。

  • enter image description here

    可能有人請幫給我一些想法,弄清楚這是怎麼回事。謝謝。歡迎任何評論。

    更新

    我搜索與關鍵文本 「NHibernate的」 在Web.Config

    含量大約是下面。

    <runtime> 
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> 
         <dependentAssembly> 
         <assemblyIdentity name="Iesi.Collections" publicKeyToken="aa95f207798dfdb4"/> 
         <bindingRedirect oldVersion="1.0.0.3" newVersion="1.0.1.0"/> 
         </dependentAssembly> 
         <dependentAssembly> 
         <assemblyIdentity name="NHibernate" publicKeyToken="aa95f207798dfdb4"/> 
         <bindingRedirect oldVersion="2.0.1.4000" newVersion="2.1.0.4000"/> 
         </dependentAssembly> 
        </assemblyBinding> 
        <assemblyBinding appliesTo="v2.0.50727" xmlns="urn:schemas-microsoft-com:asm.v1"> 
         <dependentAssembly> 
         <assemblyIdentity name="Oracle.DataAccess" publicKeyToken="89b483f429c47342" processorArchitecture="amd64"/> 
         <bindingRedirect oldVersion="2.102.4.0" newVersion="2.112.2.0"/> 
         </dependentAssembly> 
         <dependentAssembly> 
         <assemblyIdentity name="Oracle.DataAccess" publicKeyToken="89b483f429c47342" processorArchitecture="ia64"/> 
         <bindingRedirect oldVersion="2.102.4.0" newVersion="2.112.2.0"/> 
         </dependentAssembly> 
        </assemblyBinding> 
        </runtime> 
    

    更新

    我在Reflector檢查DLL,什麼錯呢?

    enter image description here

    更新

    反彙編的manifast顯示以下 enter image description here

    更新

    有時候我發現日誌顯示了一些線索,其裝配引用錯誤的DLL。 你可以看到「調用程序集:xxxx.dll,版本= .........」

    +0

    我不知道,但我認爲問題是在你的web.config文件不是關於DLL的 – MustafaP

    +0

    而我想知道哪個DLL引用這個錯誤的DLL。它是如何加載的。謝謝。 –

    回答

    2

    它看起來像是你的dll文件本身的問題。.dll文件的清單已經以錯誤的方式聲明瞭版本詳細信息。嘗試從其他資源下載該文件的另一個副本。現在清理解決方案,添加對其的引用並重建解決方案。錯誤應該去。

    +0

    或者,您可以使用十六進制編輯器編輯'.dll'文件的清單並更改版本詳細信息。 –

    +0

    你可以看到DLL已綁定兩次。其中之一是錯誤的版本。請檢查上面的跟蹤日誌。謝謝。我無法理解爲什麼綁定兩次。 –

    +0

    你可以看到的兩個綁定基本上是同一個dll的兩個不同部分。這兩部分的版本不匹配。 –

    相關問題