2011-07-14 12 views
5

budynek tego projektu działa na komputerze mojego przyjaciela, ale nie na moim.Wykryto błąd wiązania "Microsoft.Practices.EnterpriseLibrary.Validation"

na tej linii powrotnej:

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

otrzymuję następujący błąd:

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.

tutaj są wszystkie odniesienia mam:

enter image description here

Zrobiłem pobrania najnowszą bibliotekę korporacyjną i zainstaluj ją, a ja zastąpiłem wszystkie DL LS na powyższym zdjęciu będzie wszystkie ich zaktualizowane wersje.

co robię źle?

+0

Czy twoje pliki konfiguracyjne mają ref. do którejś ze starych bibliotek DLL? –

Odpowiedz

10

W porządku Znalazłem rozwiązanie. Nigdy nie mogłem zaakceptować wyłączania wyjątków jako odpowiedzi. Po prostu wydaje się jakoś nie tak ...

To, co zdaje się dziać, to fakt, że w poprzednich złożeniach lub w poprzednich wersjach bieżącego zestawu niektóre odniesienia były używane zewnętrznie. Mimo że twój kod już dawno porzucił te odniesienia, nazwy są nadal, gdzieś tajemnicze, szuka się ich w zgromadzeniu.

przejdź do plików AssemblyInfo.cs i znaleźć 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))] 

Zmień pierwsze miejsce na 'None':

[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))] 

i zachować swoje wyjątki włączony! Będę zamieszczał tę odpowiedź na różne pytania o tej podobnej naturze.

6

To nie jest błąd krytyczny; to Managed Debugging Assistant, ostrzegający o potencjalnym problemie.
Przejdź do debugowania, wyjątków i odznacz je.

Możesz również nacisnąć przycisk F5, aby kontynuować wykonywanie.

+0

DZIĘKI !!!!!!!!!!!!!!!!!!!!!!!! –

+0

mieć niesamowite shabbas –

+0

checkboxy są dla mnie wyłączone, w jaki sposób mogę je odznaczyć? –

1

Czyszczenie /bin folderu pomógł mi rozwiązać ten problem

0

Binding Awaria fix: W Visual Studio 2015 -> Zakładka Debug-> Windows-> Ustawienia Wyjątek -> Wyjście rada ustawienie poniżej prawy-dolny -> Zarządzane debugowanie Asystenci -> Un-check BindingFailure

Powiązane problemy