Tôi đã cố gắng giải quyết vấn đề ràng buộc lắp ráp trong 12 giờ qua, không có nhiều may mắn. Tuần trước, tôi đã nâng cấp tất cả các dự án trong một giải pháp từ EF 4.1.0.0 lên EF 4.3.1.0. Tôi đã thêm một số thử nghiệm vào sáng nay cho một dự án thử nghiệm hiện có, làm sạch và biên dịch lại giải pháp. Tất cả các dự án biên dịch không có cảnh báo hoặc lỗi. Tại cuộc gọi khuôn khổ thực thể của tôi bất cứ nơi nào trong dự án, tôi nhận được ngoại lệ sau đây:Ràng buộc lắp ráp Tham khảo ngoại lệ cũ
phương pháp khởi NutricityPPCTests.Common.DizzleProductExtensionsTests.TestSetup ném ngoại lệ. System.IO.FileLoadException: System.IO.FileLoadException: Không thể tải tệp hoặc lắp ráp 'EntityFramework, Version = 4.1.0.0, Văn hóa = trung lập, PublicKeyToken = b77a5c561934e089' hoặc một trong số các phụ thuộc của nó. Định nghĩa tệp kê khai của assembly được đặt không khớp với tham chiếu assembly. (Ngoại lệ từ HRESULT: 0x80131040).
Tôi đã kích hoạt trình xem nhật ký ràng buộc lắp ráp tổng hợp và tìm thấy mục nhập nhật ký tương ứng với ngoại lệ. Tôi đã xác minh rằng dự án thử nghiệm của tôi, dự án MOMData cả hai đang tham khảo lắp ráp EF4.3.1.0 chính xác. Tôi đã xác minh rằng không có tham chiếu đến EF 4.1.0.0 trong các tệp dự án. Tôi đã xóa nội dung của các thư mục obj và bin trong cả hai dự án. Dự án đã được làm sạch và xây dựng lại rất nhiều lần, rằng ổ cứng của tôi có thể sẽ phát hành vào ngày mai.
*** Assembly Binder Log Entry (3/22/2012 @ 5:55:11 PM) ***
The operation failed.
Bind result: hr = 0x80131040. No description available.
Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
Running under executable c:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\QTAgent32.exe
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: User = NUTRICITY0\awolske
LOG: DisplayName = EntityFramework, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
(Fully-specified)
LOG: Appbase = file:///C:/Users/awolske/Documents/NutricityWorkspace/Nutricity/NutricityPPCTests/bin/Release
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = QTAgent32.exe
Calling assembly : MomData, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Users\awolske\Documents\NutricityWorkspace\Nutricity\NutricityPPCTests\bin\Release\NutricityPPCTests.DLL.config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: EntityFramework, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/Users/awolske/Documents/NutricityWorkspace/Nutricity/NutricityPPCTests/bin/Release/EntityFramework.DLL.
LOG: Assembly download was successful. Attempting setup of file: C:\Users\awolske\Documents\NutricityWorkspace\Nutricity\NutricityPPCTests\bin\Release\EntityFramework.dll
LOG: Entering run-from-source setup phase.
LOG: Assembly Name is: EntityFramework, Version=4.3.1.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
WRN: Comparing the assembly name resulted in the mismatch: Minor Version
ERR: The assembly reference did not match the assembly definition found.
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
Tôi nên tìm kiếm hội đồng tham chiếu cũ ở đâu?!? Bất kỳ trợ giúp sẽ được chào đón, và đánh giá cao! Cảm ơn trước cho thời gian của bạn!
Nó không phải là MomData. Nó là một assembly nó sử dụng tên NutricityPPCTests mà vẫn có tham chiếu cũ. –