2012-06-14 11 views
6

Tengo una solución de Visual Studio 2010 que contiene una biblioteca de clases (ProjectA) y dos proyectos de Sharepoint (ProjectB & ProjectC). La orden de dependencia es ProjectB hace referencia a las referencias ProejctA y ProjectC tanto ProjectA & ProjectB.Error de encuadernación en ensamblaje: Resultado de unión: hr = 0x80070002. El sistema no puede encontrar el archivo especificado

En una máquina de desarrollo particular, me sale el siguiente error al intentar construir ProjectC:

Compilation failed. Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.

Cuando se busca en el registro de la fusión Noté el siguiente error:

* Assembly Binder Log Entry (14/06/2012 @ 09:38:32) *

The operation failed.

Bind result: hr = 0x80070002. The system cannot find the file specified.

Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll

Running under executable C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe

--- A detailed error log follows.

=== Pre-bind state information === LOG: User = DOMAIN\username

LOG: DisplayName = ProjectB, Version=0.0.0.0, Culture=neutral, PublicKeyToken=aaaaaaaaaaaaaaaa, processorArchitecture=MSIL (Fully-specified)

LOG: Appbase = file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/

LOG: Initial PrivatePath = NULL

LOG: Dynamic Base = NULL

LOG: Cache Base = NULL

LOG: AppName = devenv.exe

Calling assembly : (Unknown).

LOG: This bind starts in default load context.

LOG: Using application configuration file: C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe.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: ProjectB, Version=0.0.0.0, Culture=neutral, PublicKeyToken=aaaaaaaaaaaaaaaa, processorArchitecture=MSIL

LOG: GAC Lookup was unsuccessful.

LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/ProjectB.DLL. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/ProjectB/ProjectB.DLL. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/PublicAssemblies/ProjectB.DLL. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/PublicAssemblies/ProjectB/ProjectB.DLL. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/PrivateAssemblies/ProjectB.DLL. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/PrivateAssemblies/ProjectB/ProjectB.DLL. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/CommonExtensions/Microsoft/TemplateProviders/ProjectB.DLL. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/CommonExtensions/Microsoft/TemplateProviders/ProjectB/ProjectB.DLL. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/PrivateAssemblies/DataCollectors/ProjectB.DLL. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/PrivateAssemblies/DataCollectors/ProjectB/ProjectB.DLL. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/PrivateAssemblies/DataCollectors/x86/ProjectB.DLL. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/PrivateAssemblies/DataCollectors/x86/ProjectB/ProjectB.DLL. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/CommonExtensions/Microsoft/Editor/ProjectB.DLL. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/CommonExtensions/Microsoft/Editor/ProjectB/ProjectB.DLL. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/CommonExtensions/Platform/Debugger/ProjectB.DLL. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/CommonExtensions/Platform/Debugger/ProjectB/ProjectB.DLL. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/ProjectB.EXE. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/ProjectB/ProjectB.EXE. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/PublicAssemblies/ProjectB.EXE. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/PublicAssemblies/ProjectB/ProjectB.EXE. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/PrivateAssemblies/ProjectB.EXE. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/PrivateAssemblies/ProjectB/ProjectB.EXE. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/CommonExtensions/Microsoft/TemplateProviders/ProjectB.EXE. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/CommonExtensions/Microsoft/TemplateProviders/ProjectB/ProjectB.EXE. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/PrivateAssemblies/DataCollectors/ProjectB.EXE. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/PrivateAssemblies/DataCollectors/ProjectB/ProjectB.EXE. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/PrivateAssemblies/DataCollectors/x86/ProjectB.EXE. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/PrivateAssemblies/DataCollectors/x86/ProjectB/ProjectB.EXE. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/CommonExtensions/Microsoft/Editor/ProjectB.EXE. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/CommonExtensions/Microsoft/Editor/ProjectB/ProjectB.EXE. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/CommonExtensions/Platform/Debugger/ProjectB.EXE. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/CommonExtensions/Platform/Debugger/ProjectB/ProjectB.EXE. LOG: All probing URLs attempted and failed.

que he intentado:

  1. Eliminando la referencia a ProjectB y volviéndola a agregar:
    • a) como una referencia de proyecto
    • b) como un manual de referencia directamente a la carpeta de depuración de ProjectB
  2. colocar manualmente el ProjectB.dll en la GAC ​​
  3. Cambio de la "copia local" opción de Verdadero a Falso (y volver a Verdadero)

Y solo (2) colocar el conjunto en el GAC permite que ProjectC construya. ¿Por qué no encuentra el conjunto como debería (y lo hace en otras máquinas)?

+0

son todas las máquinas de 64 bits o simplemente éste? –

+0

Todos son Windows Server 2008 R2 de 64 bits – mundeep

Respuesta

3

Así resulta que el motivo de la asamblea no se pudo encontrar fue porque somos Delayed Signing the Assemblies esto significa que:

Because the assembly does not have a valid strong name signature, the verification of that signature must be turned off. You can do this by using the –Vr option with the Strong Name tool.

que ya había hecho esto para todas las claves públicas necesarias sin embargo, sólo en el comando x64 Visual Studio rápido. También necesitaba agregar la omisión de verificación para x86 en la versión x86 del Símbolo del sistema de Visual Studio.

Sólo he podido encontrar esto porque probar un script de generación/distribución basada comando específico Noté la siguiente excepción con uno de los conjuntos de prueba:

Could not load file or assembly 'ProjectC.Tests, Version=0.0.0.0, Culture=neutral, PublicKeyToken=e72f8d3506b83180' or one of its dependencies. Strong name validation failed. (Exception from HRESULT: 0x8013141A)

3

PublicKeyToken = aaaaaaaaaaaaaaaa puede ser diferente o puede ser que el número de versión del ensamblaje sea diferente. Creo que debería usar Fusion Log Viewer to Debug como se describe y espero que pueda resolver completamente su problema.

+1

a) Fusion Log está por encima de lo que puedo entender, ya que comprueba el GAC y luego, por alguna razón, las carpetas IDE en lugar de las carpetas bin de proyecto. (b) Como mencioné anteriormente si coloco manualmente el ensamblado de ProjectB en el GAC, se encuentra (lo que implica que la clave es correcta) - He comprobado manualmente (sn - T) y la clave es la misma. – mundeep

+0

puede pegar la clave que ha verificado utilizando (sn-T) y también el número de versión de ensamblaje. – MMK

+0

Así que eliminé el dll de ProjectB del GAC e intenté construir de nuevo. Obtengo lo siguiente en fusión: === Información de estado de enlace previo === REGISTRO: Usuario = DOMINIO \ nombre de usuario REGISTRO: DisplayName = ProyectoB, Versión = 0.0.0.0, Culture = neutral, PublicKeyToken = e72f8d3506b83180, processorArchitecture = MSIL (Completamente especificado) LOG: Appbase = archivo: /// C:/Archivos de programa (x86)/Microsoft Visual Studio 10.0/Common7/IDE/ .. ... LOG: Referencia posterior a la política: ProjectB, Version = 0.0.0.0, Culture = neutral, PublicKeyToken = e72f8d3506b83180, processorArchitecture = MSIL LOG: La búsqueda de GAC no tuvo éxito. – mundeep

Cuestiones relacionadas