2011-07-14 15 views
5

la construcción de este proyecto está funcionando en la computadora de mi amigo pero no en la mía.Se detectó un error de enlace 'Microsoft.Practices.EnterpriseLibrary.Validation'

en esta línea de retorno:

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

que estoy recibiendo el siguiente error:

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.

aquí son todas las referencias que tengo:

enter image description here

que hice descarga la última biblioteca de la empresa e instalarlo y reemplacé todo el DL LS en la imagen de arriba todas las versiones actualizadas de ellos.

¿Qué estoy haciendo mal?

+0

¿Sus archivos de configuración tienen una referencia? a cualquiera de los viejos DLL? –

Respuesta

10

Bien Encontré una solución. Nunca pude aceptar desactivar excepciones como respuesta. Parece de alguna manera incorrecto ...

Lo que parece estar sucediendo es que en montajes anteriores o versiones anteriores de su ensamblaje actual, ciertas referencias se usaban externamente. A pesar de que su código puede haber abandonado esas referencias desde hace mucho tiempo, los nombres son aún, algunos misteriosos en alguna parte, que se buscan en el ensamblado.

Ir a los archivos y encontrar AssemblyInfo.cs 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))] 

cambiar el primer lugar en 'No':

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

y mantener sus excepciones encendido! Estaré publicando esta respuesta a varias preguntas de esta naturaleza similar.

6

Esto no es un error fatal; es un asistente de depuración administrada, lo alerta sobre un posible problema.
Vaya a Depurar, Excepciones y desmárquelo.

También puede simplemente presionar F5 para continuar la ejecución.

+0

GRACIAS !!!!!!!!!!!!!!!!!!!!!!!! –

+0

tengo un impresionante shabbas –

+0

las casillas de verificación están desactivadas para mí ¿cómo puedo desmarcarlo? –

1

limpieza /bin carpeta ayudó a solucionar este problema

0

ha solucionado el error Encuadernación: En Visual Studio 2015 -> Pestaña de Depuración> Windows-> Excepción Configuración -> Salida de la junta de ajustes siguiente parte inferior derecha -> Depuración Gestionado Asistentes -> Desmarcar BindingFailure

Cuestiones relacionadas