簡體   English   中英

ASP.NET WEb.config引用程序集

[英]ASP.NET WEb.config Referencing an assembly

嗨,我在Web.config(.net 4.0)項目中生成了3行代碼,如下所示

<configSections>
      <section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=5.0.414.0, Culture=neutral,PublicKeyToken=31bf3856ad364e35" requirePermission="false" />
</configSections>

When I run the project I get the error
: Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Data, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

但是我從私有文件夾中引用該程序集Microsoft.Practices.EnterpriseLibrary.Data,在項目中它可能沒有強名,等等(我確實添加了引用,瀏覽到私有文件夾並添加了Microsoft.Practices.EnterpriseLibrary.Data庫)。

我希望我可以在項目配置中的某個地方找到添加的庫(不知道在哪里-我搜索了屬性等。因此我可以在Web.config中不用強名稱等替換該值,然后繼續。有人可以幫忙嗎?

謝謝

打開一個新項目,然后嘗試通過NuGet添加引用並比較您的配置條目。

您只是引用了錯誤的程序集版本。

我發現連接字符串存在問題。 我正在連接SQL Server Compact,但沒有提供名稱。 這導致了問題。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM