2015-09-07 94 views
5

我的電腦在VS2013中構建代碼時崩潰。重啓後運行我的代碼,而無需調試運行良好,但是當在調試模式下,我得到了以下異常:計算機崩潰後VS 2013未加載'Antlr3.Runtime'程序集

Could not load file or assembly 'Antlr3.Runtime' or one of its dependencies. The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))

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 'Antlr3.Runtime' or one of its dependencies. The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))

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 'Antlr3.Runtime' could not be loaded.

=== Pre-bind state information === LOG: DisplayName = Antlr3.Runtime (Partial) WRN: Partial binding information was supplied for an assembly: WRN: Assembly Name: Antlr3.Runtime | 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:/qqq/qqq.Admin/ LOG: Initial PrivatePath = D:\qqq\qqq.Admin\bin

Calling assembly : (Unknown).

LOG: This bind starts in default load context. LOG: Using application configuration file: D:\qqq\qqq.Admin\web.config LOG: Using host configuration file: C:\Users\DevBatch\Documents\IISExpress\config\aspnet.config LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\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/Framework/v4.0.30319/Temporary ASP.NET Files/root/051d9c22/9e0bcfb5/Antlr3.Runtime.DLL. LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/051d9c22/9e0bcfb5/Antlr3.Runtime/Antlr3.Runtime.DLL. LOG: Attempting download of new URL file:///D:/qqq/qqq.Admin/bin/Antlr3.Runtime.DLL. LOG: Using application configuration file: D:\qqq\qqq.Admin\web.config LOG: Using host configuration file: C:\Users\DevBatch\Documents\IISExpress\config\aspnet.config LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config. LOG: Post-policy reference: Antlr3.Runtime, Version=3.3.1.7705, Culture=neutral, PublicKeyToken=31bf3856ad364e35 ERR: Failed to complete setup of assembly (hr = 0x80070057). Probing terminated.

Stack Trace:

[FileLoadException: Could not load file or assembly 'Antlr3.Runtime' or one of its dependencies. The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))]

[FileLoadException: Could not load file or assembly 'Antlr3.Runtime, Version=3.3.1.7705, 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.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +34 System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +152 System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) +77 System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +16 System.Reflection.Assembly.Load(String assemblyString) +28 System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +38

[ConfigurationErrorsException: Could not load file or assembly 'Antlr3.Runtime, Version=3.3.1.7705, 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) +736 System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +217 System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +130 System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +170 System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() +91 System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded) +284 System.Web.Compilation.BuildManager.ExecutePreAppStart() +153 System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +521

[HttpException (0x80004005): Could not load file or assembly 'Antlr3.Runtime, Version=3.3.1.7705, 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) +9931916 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254

我已經做了我[R & d和最接近的解決方案,我得到的是從刪除所有文件

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\

而且也不清楚這些

C:/Users[username]/AppData/Local/Temp/Temporary ASP.NET Files/

另外,我已經重裝 'Antlr3.Runtime' DLL但至今沒有運氣。

+0

您是否嘗試過刪除'Framework'中的文件? (不''Framework64') –

+0

是的,我已經刪除了所有文件.. –

+0

即使我已經通過nuget包更新了我的Antlr3.Runtime dll,DotNetOpenAuth.aspnet dll和EntityFramework dll,但到目前爲止沒有運氣 –

回答

1

這裏爲你唯一的解決辦法,就是創建一個新的項目,在調試運行(以確保其工作正常),然後所有的項目複製到新創建的一個(您可以嘗試使用TFS進行合併爲了節省時間)。

事情是,一旦工作室碾壓,它被毀了,因爲這個具體的Antlr3.Runtime,混合以及不能重新創建自己。這是一個需要注意的問題。

+0

我也試過這個..仍然是同樣的問題..即使我通過nuget包更新了我各自的dll,但目前還沒有運氣! –

+0

然後再做最後一件事,卸載Visual Studio並重新安裝。 –

0

嘗試手動將該文件(Antlr3.Runtime.dll)複製到bin文件夾中。

3

我正在努力解決這個問題,經過2個小時的搜索和嘗試,我在這裏找到了一個簡單的解決方案。

  1. 刪除所有文件在C:\ WINDOWS \ Microsoft.NET \ Framework64 \ v4.0.30319 \臨時ASP.NET文件\ ROOT \
  2. 刪除C中的所有文件:\ WINDOWS \ Microsoft.NET \框架\ v4.0.30319 \ Temporary ASP.NET Files \ root \
  3. Clear C:/ Users/[username]/AppData/Local/Temp/Temporary ASP.NET Files /(如果有的話)。
  4. 刪除所有文件在C:\ WINDOWS \ Microsoft.NET \框架\ v4.0.30319 \臨時ASP.NET文件\ VS \

enter image description here

+0

這是唯一對我有用的答案.. – user1073075

0

我之前遇到過這個問題,做的最好的事情是清除臨時文件夾,並刪除所有文件放在項目的bin文件夾。乾淨的解決方案和重建,Tadang!你很好去:)希望這有助於有人來這裏尋找未來的答案。