2013-02-21 16 views
5

Tôi đã cố gắng để upgarde doanh nghiệp Thư viện của tôi từ 4.0.0.0 đến 5.0.5.0lỗi khi nâng cấp lên Microsoft.Practices.EnterpriseLibrary.Caching EL 5' ..or một trong những phụ thuộc của nó

tôi biết cách an toàn là sử dụng NuGet.

tôi đã sử dụng nó, nhưng nhận được lỗi này:

An error occurred creating the configuration section handler for cachingConfiguration: Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Caching, Version=5.0.505.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Configuration Error 




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: An error occurred creating the configuration section handler for cachingConfiguration: Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Caching, Version=5.0.505.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) 




Source Error:  








Line 8:      <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> 
Line 9:      <section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=5.0.505.0, Culture=neutral, PublicKeyToken=null" /> 
Line 10:     <section name="cachingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Caching.Configuration.CacheManagerSettings, Microsoft.Practices.EnterpriseLibrary.Caching, Version=5.0.505.0, Culture=neutral, PublicKeyToken=null" /> 
Line 11:     <section name="instrumentationConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Common.Instrumentation.Configuration.InstrumentationConfigurationSection, Microsoft.Practices.EnterpriseLibrary.Common, Version=5.0.505.0, Culture=neutral, PublicKeyToken=null" /> 
Line 12:     <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" /> 




Source File: D:\MaM\Server\ClientServices\Dev\ClientService 1.5\Conduit.Mam.ClientService.Service\web.config    Line: 10  




Assembly Load Trace: The following information can be helpful to determine why the assembly 'Microsoft.Practices.EnterpriseLibrary.Caching, Version=5.0.505.0, Culture=neutral, PublicKeyToken=null' could not be loaded. 








=== Pre-bind state information === 
LOG: User = CONDUIT-IL\elad.bendavid 
LOG: DisplayName = Microsoft.Practices.EnterpriseLibrary.Caching, Version=5.0.505.0, Culture=neutral, PublicKeyToken=null 
 (Fully-specified) 
LOG: Appbase = file:///D:/MaM/Server/ClientServices/Dev/ClientService 1.5/Conduit.Mam.ClientService.Service/ 
LOG: Initial PrivatePath = D:\MaM\Server\ClientServices\Dev\ClientService 1.5\Conduit.Mam.ClientService.Service\bin 
Calling assembly : (Unknown). 
=== 
LOG: This bind starts in default load context. 
LOG: Using application configuration file: D:\MaM\Server\ClientServices\Dev\ClientService 1.5\Conduit.Mam.ClientService.Service\web.config 
LOG: Using host configuration file:  
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config. 
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind). 
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/fb9f9038/ea6afb52/Microsoft.Practices.EnterpriseLibrary.Caching.DLL. 
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/fb9f9038/ea6afb52/Microsoft.Practices.EnterpriseLibrary.Caching/Microsoft.Practices.EnterpriseLibrary.Caching.DLL. 
LOG: Attempting download of new URL file:///D:/MaM/Server/ClientServices/Dev/ClientService 1.5/Conduit.Mam.ClientService.Service/bin/Microsoft.Practices.EnterpriseLibrary.Caching.DLL. 
WRN: Comparing the assembly name resulted in the mismatch: PUBLIC KEY TOKEN 
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated. 

web.config của tôi:

Tôi đã cố gắng để xem với NuGet, những gì dll phụ thuộc với những gì dll.

tôi xác minh và tất cả các file dll với các phiên bản đúng được refrenced (cài đặt bởi NuGet)

tôi đã cố gắng DependenciesWallker, nhưng không thể hiểu những gì đang mất tích.

+0

Bạn đã xem nhật ký được tạo bởi fuslogvw.exe chưa? Nó sẽ cung cấp cho bạn nhiều chi tiết hơn về lắp ráp chính xác mà không tải được. (http://msdn.microsoft.com/en-us/library/e74a18c4(v=VS.100).aspx) – Jomit

+0

Ngoài ra, hãy kiểm tra kỹ PublicKeyToken của DLL và tệp được đề cập trong web.config của bạn. (Microsoft.Practices.EnterpriseLibrary.Caching, Phiên bản = 5.0.505.0, Văn hóa = trung lập, PublicKeyToken = 31bf3856ad364e35) – Jomit

+0

@ Jomit nếu tôi đặt tất cả PublicKeyToken = null vào web.config của tôi, nó có hoạt động không? –

Trả lời

4

Bạn cần sử dụng khóa công khai thực tế mà các hội đồng đã được ký kết. Chỉ cần đặt NULL sẽ cho bạn một sự không khớp và không tải được.

+0

cảm ơn bạn hàng nghìn lần! – Pascamel

0

Vui lòng thêm lại tệp mô hình thực thể ADO.NET vào dự án. Không xóa cái hiện có. Bạn chỉ cần tạo thêm một tệp .edmx vào dự án. Nó sẽ tham khảo các tập tin DLL phiên bản 5.0 mới vào dự án và thêm các mã vào tập tin cấu hình cũng. Sau khi thêm tệp, bạn có thể xóa tệp khỏi dự án. Chỉ để thêm tham chiếu mới được tạo vào dự án. Hãy thử nó sẽ hoạt động ....

1

Tôi cũng gặp ngoại lệ này. Hóa ra phần configSections trong web.config đã tham chiếu đến khung công tác 4.0. Thay đổi phần này đã giải quyết vấn đề này cho tôi:

<configuration> 
    <configSections> 
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />