2012-07-31 17 views
8

Ho un'applicazione Azure multilivello su cui sto lavorando. Utilizza i ruoli web e di lavoro dietro un front-end MVC, oltre all'archiviazione di SQL e tabella di Azure. Ha funzionato bene per un po ', sia nell'emulatore che nel cloud.Cosa potrebbe causare un errore "impossibile caricare file o assembly" relativo a "Microsoft.WindowsAzure.Configuration"?

Ho appena iniziato l'aggiunta di alcune funzionalità Service Bus ad esso, aggiungendo il pacchetto di servizio di autobus da NuGet, e ora scopro che anche se tutto compila ancora, sto ottenendo il seguente errore di runtime:

Server Error in '/' Application. 
Could not load file or assembly 'Microsoft.WindowsAzure.Configuration' or one of its dependencies. Strong name signature could not be verified. The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045) 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.IO.FileLoadException: Could not load file or assembly 'Microsoft.WindowsAzure.Configuration' or one of its dependencies. Strong name signature could not be verified. The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045) 

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 

Assembly Load Trace: The following information can be helpful to determine why the assembly 'Microsoft.WindowsAzure.Configuration' could not be loaded. 


=== Pre-bind state information === 
LOG: User = JCFXLAPTOP\User 
LOG: DisplayName = Microsoft.WindowsAzure.Configuration 
(Partial) 
WRN: Partial binding information was supplied for an assembly: 
WRN: Assembly Name: Microsoft.WindowsAzure.Configuration | Domain ID: 2 
WRN: A partial bind occurs when only part of the assembly display name is provided. 
WRN: This might result in the binder loading an incorrect assembly. 
WRN: It is recommended to provide a fully specified textual identity for the assembly, 
WRN: that consists of the simple name, version, culture, and public key token. 
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue. 
LOG: Appbase = file:///D:/Work/CLIENTS/PageEngine/Solutions/PageEngine/Web.PageEngine/ 
LOG: Initial PrivatePath = D:\Work\CLIENTS\PageEngine\Solutions\PageEngine\Web.PageEngine\bin 
Calling assembly : (Unknown). 
=== 
LOG: This bind starts in default load context. 
LOG: Using application configuration file: D:\Work\CLIENTS\PageEngine\Solutions\PageEngine\Web.PageEngine\web.config 
LOG: Using host configuration file: C:\Program Files\IIS Express\config\templates\PersonalWebServer\aspnet.config 
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\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:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/root/4904ccbc/14659c77/Microsoft.WindowsAzure.Configuration.DLL. 
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/root/4904ccbc/14659c77/Microsoft.WindowsAzure.Configuration/Microsoft.WindowsAzure.Configuration.DLL. 
LOG: Attempting download of new URL file:///D:/Work/CLIENTS/PageEngine/Solutions/PageEngine/Web.PageEngine/bin/Microsoft.WindowsAzure.Configuration.DLL. 
LOG: Using application configuration file: D:\Work\CLIENTS\PageEngine\Solutions\PageEngine\Web.PageEngine\web.config 
LOG: Using host configuration file: C:\Program Files\IIS Express\config\templates\PersonalWebServer\aspnet.config 
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config. 
LOG: Post-policy reference: Microsoft.WindowsAzure.Configuration, Version=1.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 
ERR: Failed to complete setup of assembly (hr = 0x80131045). Probing terminated. 


Stack Trace: 


[FileLoadException: Could not load file or assembly 'Microsoft.WindowsAzure.Configuration' or one of its dependencies. Strong name signature could not be verified. The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045)] 

[FileLoadException: Could not load file or assembly 'Microsoft.WindowsAzure.Configuration, Version=1.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. Strong name signature could not be verified. The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045)] 
    System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0 
    System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +210 
    System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) +242 
    System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +17 
    System.Reflection.Assembly.Load(String assemblyString) +35 
    System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +122 

[ConfigurationErrorsException: Could not load file or assembly 'Microsoft.WindowsAzure.Configuration, Version=1.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. Strong name signature could not be verified. The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045)] 
    System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +12731430 
    System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +503 
    System.Web.Configuration.AssemblyInfo.get_AssemblyInternal() +142 
    System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +334 
    System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath) +203 
    System.Web.Compilation.BuildManager.ExecutePreAppStart() +152 
    System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +1151 

[HttpException (0x80004005): Could not load file or assembly 'Microsoft.WindowsAzure.Configuration, Version=1.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. Strong name signature could not be verified. The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045)] 
    System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +12847312 
    System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +159 
    System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +12675965 

Ho notato che il pacchetto ServiceBus NuGet fa riferimento a una versione più recente di Microsoft.WindowsAzure.Configuration dll (1.7.0.2) e si chiedeva se ciò potesse essere la causa. Ho provato a sovrascrivere questo e cambiando tutti i riferimenti su 1.7.0.0 o 1.7.0.2 - nessuno dei due ha aiutato. Ho anche provato a rimuovere tutti i riferimenti di Azure dalla soluzione e ad aggiungere nuovamente riferimenti installando i pacchetti NuGet e facendo riferimento all'ultimo SDK. Questo non ha aiutato neanche.

Devo aggiungere che in ogni momento la dll Microsoft.WindowsAzure.Configuration è stata nella cartella bin dell'applicazione MVC e ha sempre impostato CopyLocal su true.

Ho notato che il pacchetto NuGet di Azure Configuration è stato aggiornato di recente (venerdì 27 luglio) e mi chiedo se questo potrebbe avere qualcosa a che fare con esso.

Qualcuno sa quale potrebbe essere il problema?

EDIT

solo per confermare che la rimozione del pacchetto di bus NuGet servizio risolve il problema. Il suo ripristino fa sì che il problema si ripresenti. Non so se questo è importante ma la DLL Microsoft.WindowsAzure.Configuration aggiunta come parte del pacchetto NuGet sembra avere un numero di versione incoerente. Mentre il percorso suggerisce la versione dovrebbe essere 1.7.0.2:

D: \ Work \ CLIENTS \ PageEngine \ Solutions \ PageEngine \ packages \ Microsoft.WindowsAzure.ConfigurationManager. 1.7.0.2 \ lib \ net35 pieno \ Microsoft.WindowsAzure.Configuration.dll

... il numero di versione nel proprietà ispettore è ancora 1.7.0.0

risposta

4

Questo era un problema con il complesso Microsoft.WindowsAzure.Configuration, versione 1.7.0.2

temporaneamente fissato rotolando indietro a uno 1.7.0.1 o 1.7.0.0 e poi definitivamente fissata 1.7.0.3

3

Ha avuto lo stesso problema. Ho ripristinato Microsoft.WindowsAzure.ConfigurationManager di nuovo in NuGet versione 1.7.0.1. Ora funziona OK.

+0

Grazie per aver trovato il tempo di rispondere. Ho risolto il problema in modo analogo ottenendo l'ultimo pacchetto Bus di servizio da NuGet e rimuovendo tutti i riferimenti su 1.7.0.2 e facendo riferimento a 1.7.0.0 manualmente. Lascerò la domanda dal vivo anche se mi piacerebbe vedere se qualcuno nella comunità può dire perché questo sta accadendo. – JcFx

+0

Lo stesso problema qui. 1.7.0.1 funziona correttamente. –

+3

Grazie - Sto facendo in modo che il team lo analizzi nel frattempo. mi dispiace! –

Problemi correlati