2012-10-07 126 views
10

我的系統崩潰了兩天以前,從那時起,當我嘗試調試本地Azure的環境,我得到這個錯誤「無法加載文件或程序程序集'Microsoft.WindowsAzure.Diagnostics'或它的一個依賴項'。無法加載文件或程序集「Microsoft.WindowsAzure.Diagnostics」或它的一個依賴

我重新安裝下面(的Windows Azure工具MS VS 2012 2012年6月SP1,Windows Azure的模擬器 - 2012年6月,Windows Azure的Librarires爲.NET - 2012年6月)。

仍然有同樣的問題,有什麼建議。

=== Pre-bind state information === 
LOG: User = ........... 
LOG: DisplayName = Microsoft.WindowsAzure.Diagnostics 
(Partial) 
WRN: Partial binding information was supplied for an assembly: 
WRN: Assembly Name: Microsoft.WindowsAzure.Diagnostics | 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:///C:/Projects/Client/Connection Intelegence/CICloud/CIWebRole/ 
LOG: Initial PrivatePath = C:\Projects\Client\Connection Intelegence\CICloud\CIWebRole\bin 
Calling assembly : (Unknown). 
=== 
LOG: This bind starts in default load context. 
LOG: Using application configuration file: C:\Projects\Client\Connection   Intelegence\CICloud\CIWebRole\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/9cc4e65f/1fb72ae3/Microsoft.WindowsAzure.Diagnostics.DLL. 
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/root/9cc4e65f/1fb72ae3/Microsoft.WindowsAzure.Diagnostics/Microsoft.WindowsAzure.Diagnostics.DLL. 
LOG: Attempting download of new URL file:///C:/Projects/Client/Connection Intelegence/CICloud/CIWebRole/bin/Microsoft.WindowsAzure.Diagnostics.DLL. 
LOG: Using application configuration file: C:\Projects\Client\Connection Intelegence\CICloud\CIWebRole\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.Diagnostics, Version=1.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 



[FileLoadException: Could not load file or assembly 'Microsoft.WindowsAzure.Diagnostics' or one of its dependencies. The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))] 
[FileLoadException: Could not load file or assembly 'Microsoft.WindowsAzure.Diagnostics, Version=1.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))] 
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.Diagnostics, Version=1.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))] 
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +12761078 
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.Diagnostics, Version=1.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))] 
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +12881540 
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +159 
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +12722601 
+0

你是否設法整理出來?我只是有一個崩潰,沒有任何工程 - 同樣的錯誤 – Turowicz

回答

8

看起來應用程序啓動時會出現這種情況。看看你的web.config,你有一個跟蹤監聽器指向Microsoft.WindowsAzure.Diagnostics程序集?這可能是您的應用程序無法正常工作的原因。

首先,看看你的程序集引用和刪除Microsoft.WindowsAzure.Diagnostics它應該存在(只是爲了確保我們不使用舊版本)。然後,添加對的引用Microsoft.WindowsAzure.Diagnostics,但請確保它是1.7.0.0版。

你會發現該組件的正確版本:C:\ Program Files文件\微軟的SDK \的Windows Azure.NET SDK \ 2012-06 \裁判

+0

我有一個ref。爲1.7.0.0。順便說一句:這適用於Azure,只是本地開發是我遇到問題的地方。必須是損壞的或丟失的文件。我已經收穫了,但問題仍然存在。 – Floyd

+0

非常感謝!我已經更新了所有引用,但沒有意識到跟蹤監聽器! – dopplesoldner

4

添加到Sandrinio的回答(對不起,我不」噸有特權)我有哪裏1.7.0.0正在引用類似的錯誤,但在我的web.config本節中指出版本1.0.0.0

<system.diagnostics> 
<trace> 
    <listeners> 
    <add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" 
     name="AzureDiagnostics"> 
     <filter type="" /> 
    </add> 
    </listeners> 
</trace> 

我評論它,問題就解決了。

4

我知道這是一個老話題,但它仍然是頂級谷歌結果爲「無法加載文件或程序集Microsoft.WindowsAzure.Diagnostics」,所以這裏是我做過什麼:

這是發生在我身上帶Azure SDK 2.7.1和Visual Studio 2013.在升級到Windows 10和Azure SDK 2.7之間,某些東西沒有正確安裝。我嘗試重新安裝Azure SDK,升級到Visual Studio 2015,但都沒有工作。最後我不得不更改以下行中我的app.config:

<system.diagnostics> 
    <trace> 
     <listeners> 
      <add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=2.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="AzureDiagnostics"> 
       <filter type="" /> 
      </add> 
     </listeners> 
    </trace> 
</system.diagnostics> 

<system.diagnostics> 
    <trace> 
     <listeners> 
      <add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=2.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="AzureDiagnostics"> 
       <filter type="" /> 
      </add> 
     </listeners> 
    </trace> 
</system.diagnostics> 

通知的變化,從 「2.7.0.0」 爲 「2.5.0.0」。對我而言,Microsoft.WindowsAzure.Diagnostics 2.7.0.0 DLL並不存在。恢復到2.5.0.0可以正常工作。我仍然想找到根本原因,但我還有更重要的事情要做。希望這可以幫助!

+0

Mine was 2.5.0.0 to 2.8.0.0 – Catwood

1

這可能是最好的檢查Microsoft.WindowsAzure.Diagnostics的屬性,看你使用哪個版本。 Mine說2.8.0.0時,我將它插入Dan和Taylor提到的Web.config元素上面。 2.7.0.0對我來說並不適用2.8.0.0,但明天它可能是另外的;-)。

+0

最佳答案 - 沒有魔法「試試這個」或「刪除它」。 – Dunc

相關問題