2011-07-14 39 views
5

tòa nhà của dự án này đang hoạt động trên máy tính của bạn tôi nhưng không phải trên máy của tôi.Lỗi liên kết đã được phát hiện 'Microsoft.Practices.EnterpriseLibrary.Validation'

trên đường trở lại này:

protected static Database Connection2 
{ 
    get 
    { 
     try 
     { 
      return DatabaseFactory.CreateDatabase("HermesDB"); 
     } 
     catch (Exception e) 
     { 
      //Corpnet.Elmah.Error.Add(e); 
      return null; 
     } 
    } 
} 

tôi đang nhận được lỗi sau:

The assembly with display name 'Microsoft.Practices.EnterpriseLibrary.Validation' failed to load in the 'Load' binding context of the AppDomain with ID 1. The cause of the failure was: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Validation' or one of its dependencies. The system cannot find the file specified. File name: 'Microsoft.Practices.EnterpriseLibrary.Validation'

=== Pre-bind state information === LOG: User = MLABS\agordon LOG: DisplayName = Microsoft.Practices.EnterpriseLibrary.Validation (Partial) LOG: Appbase = file:///C:/Documents and Settings/agordon/My Documents/Projects/BulkUploadToLOMDatabase/BulkUploadToLOMDatabase/bin/Debug/ LOG: Initial PrivatePath = NULL Calling assembly : Microsoft.Practices.EnterpriseLibrary.Common, Version=5.0.414.0, Culture=neutral, PublicKeyToken=null. === LOG: This bind starts in default load context. LOG: Using application configuration file: C:\Documents and Settings\agordon\My Documents\Projects\BulkUploadToLOMDatabase\BulkUploadToLOMDatabase\bin\Debug\BulkUploadToLOMDatabase.vshost.exe.config LOG: Using machine configuration file from c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\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:/Documents and Settings/agordon/My Documents/Projects/BulkUploadToLOMDatabase/BulkUploadToLOMDatabase/bin/Debug/Microsoft.Practices.EnterpriseLibrary.Validation.DLL. LOG: Attempting download of new URL file:///C:/Documents and Settings/agordon/My Documents/Projects/BulkUploadToLOMDatabase/BulkUploadToLOMDatabase/bin/Debug/Microsoft.Practices.EnterpriseLibrary.Validation/Microsoft.Practices.EnterpriseLibrary.Validation.DLL. LOG: Attempting download of new URL file:///C:/Documents and Settings/agordon/My Documents/Projects/BulkUploadToLOMDatabase/BulkUploadToLOMDatabase/bin/Debug/Microsoft.Practices.EnterpriseLibrary.Validation.EXE. LOG: Attempting download of new URL file:///C:/Documents and Settings/agordon/My Documents/Projects/BulkUploadToLOMDatabase/BulkUploadToLOMDatabase/bin/Debug/Microsoft.Practices.EnterpriseLibrary.Validation/Microsoft.Practices.EnterpriseLibrary.Validation.EXE.

đây là tất cả các tài liệu tham khảo tôi có:

enter image description here

tôi đã tải về thư viện doanh nghiệp mới nhất và cài đặt nó và tôi đã thay thế tất cả DL LS trong hình trên sẽ tất cả các phiên bản cập nhật của chúng.

tôi đang làm gì sai?

+0

Làm các tệp cấu hình của bạn có ref. cho bất kỳ tệp DLL cũ nào? –

Trả lời

10

Được rồi tôi đã tìm được giải pháp. Tôi không bao giờ có thể chấp nhận tắt các ngoại lệ như một câu trả lời. Có vẻ như không đúng cách nào đó ....

Điều gì có vẻ xảy ra là trong các hội đồng trước đó, hoặc các phiên bản trước của hội đồng hiện tại của bạn, một số tham chiếu nhất định đã được sử dụng bên ngoài. Mặc dù mã của bạn có thể đã từ lâu từ bỏ những tài liệu tham khảo, tên vẫn còn, một số bí ẩn ở đâu đó, đang được tìm kiếm trong hội đồng.

Đến file AssemblyInfo.cs của bạn và tìm ThemeInfo:

[assembly: ThemeInfo(
ResourceDictionaryLocation.ExternalAssembly, //where theme specific resource dictionaries are located 
//(used if a resource is not found in the page, 
// or application resource dictionaries) 
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located 
//(used if a resource is not found in the page, 
// app, or any theme specific resource dictionaries))] 

Thay đổi vị trí đầu tiên 'Không':

[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located 
//(used if a resource is not found in the page, 
// or application resource dictionaries) 
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located 
//(used if a resource is not found in the page, 
// app, or any theme specific resource dictionaries))] 

Và giữ ngoại lệ của bạn bật! Tôi sẽ đăng câu trả lời này cho nhiều câu hỏi khác nhau về bản chất tương tự này.

6

Đây không phải là lỗi nghiêm trọng; đó là Trợ lý gỡ lỗi được quản lý, cảnh báo cho bạn về một vấn đề tiềm ẩn.
Đi tới Gỡ lỗi, Ngoại lệ và bỏ chọn.

Bạn cũng có thể chỉ cần nhấn F5 để tiếp tục thực hiện.

+0

THANKS !!!!!!!!!!!!!!!!!!!!!!!! –

+0

có một shabbas tuyệt vời –

+0

các hộp kiểm bị tắt đối với tôi làm cách nào tôi có thể bỏ chọn hộp kiểm này? –

1

sạch /bin thư mục giúp tôi giải quyết vấn đề này

0

Binding Không sửa chữa: Trong Visual Studio 2015 -> Tab Debug-> Windows-> Exception Setting -> Output hội đồng quản trị thiết lập bên dưới bên phải phía dưới -> Quản lý Debugging Trợ lý -> Bỏ chọn BindingFailure

Các vấn đề liên quan