2012-05-30 33 views
11

我的電腦死機了,我現在無法啓動Visual Studio 2008中我之前工作的ASP.NET Web應用程序 - 收到以下錯誤:ASP.NET無法加載大會

=== Pre-bind state information === 
LOG: User = Adam-PC\Adam 
LOG: DisplayName = log4net 
(Partial) 
LOG: Appbase = file:///C:/Users/Adam/Desktop/SV/sview/Src/StoredProcedureTest/SV.Common.Web/ 
LOG: Initial PrivatePath = C:\Users\Adam\Desktop\SV\sview\Src\StoredProcedureTest\SV.Common.Web\bin 
Calling assembly : (Unknown). 
=== 
LOG: This bind starts in default load context. 
LOG: Using application configuration file: C:\Users\Adam\Desktop\SV\sview\Src\StoredProcedureTest\SV.Common.Web\web.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:/Users/Adam/AppData/Local/Temp/Temporary ASP.NET Files/root/b898aa04/e528dbc7/log4net.DLL. 
LOG: Attempting download of new URL file:///C:/Users/Adam/AppData/Local/Temp/Temporary ASP.NET Files/root/b898aa04/e528dbc7/log4net/log4net.DLL. 
LOG: Attempting download of new URL file:///C:/Users/Adam/Desktop/SV/sview/Src/StoredProcedureTest/SV.Common.Web/bin/log4net.DLL. 
LOG: Using application configuration file: C:\Users\Adam\Desktop\SV\sview\Src\StoredProcedureTest\SV.Common.Web\web.config 
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v2.0.50727\config\machine.config. 
LOG: Post-policy reference: log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821 
ERR: Failed to complete setup of assembly (hr = 0x80070057). Probing terminated. 

Stack Trace: 


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

[FileLoadException: Could not load file or assembly 'log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821' or one of its dependencies. The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))] 
    System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +0 
    System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +43 
    System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +127 
    System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +142 
    System.Reflection.Assembly.Load(String assemblyString) +28 
    System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +46 

[ConfigurationErrorsException: Could not load file or assembly 'log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821' or one of its dependencies. The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))] 
    System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +613 
    System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +203 
    System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +105 
    System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +178 
    System.Web.Compilation.BuildProvidersCompiler..ctor(VirtualPath configPath, Boolean supportLocalization, String outputAssemblyName) +54 
    System.Web.Compilation.ApplicationBuildProvider.GetGlobalAsaxBuildResult(Boolean isPrecompiledApp) +232 
    System.Web.Compilation.BuildManager.CompileGlobalAsax() +51 
    System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +337 

[HttpException (0x80004005): Could not load file or assembly 'log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821' or one of its dependencies. The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))] 
    System.Web.Compilation.BuildManager.ReportTopLevelCompilationException() +58 
    System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +512 
    System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters) +729 

[HttpException (0x80004005): Could not load file or assembly 'log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821' or one of its dependencies. The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))] 
    System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +8921851 
    System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +85 
    System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +259 
+0

你嘗試將基準回來? – IrishChieftain

+0

是的,我試過了。這是一個臨時文件緩存問題。見下文。 –

回答

22

答案是我不得不刪除這個文件夾的內容:

C:/用戶/亞當/應用程序數據/本地/溫度/ ASP.NET臨時文件/根/

+1

你是最好的..謝謝..你救我的屁股..:D – bot

+0

它的作品就像一個魅力!只是一個問題:爲什麼會發生? – frabiacca

+0

謝謝!!!!你也救了我的屁股 –

19

藍屏後,我有同樣的錯誤代碼,但與AutoMapper .dll在VS 2010中用於.NET 4.0 MVC 3項目。對我來說,決議是要刪除的內容:

C:\ WINDOWS \ Microsoft.NET \框架\ v4.0.30319 \臨時ASP.NET文件\ TEMP

(這是Windows 7 64位系統)

看來錯誤信息'綁定結果:小時= 0x80070057。該參數不正確。'當引用的DLL的臨時副本由於系統故障而損壞時,可能會導致該問題。解決辦法是刪除這個臨時副本。然後當你重新編譯時,編譯器會將原始DLL重新複製到臨時文件夾中。

+2

除了我必須刪除C:\ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ Temporary ASP .NET Files \ root – cchamberlain

+2

也可能需要檢查C:\ Windows \ Microsoft.NET \ Framework64 \ v4.0.30319 \ Temporary ASP.NET文件(注意Framework64) – DJA

+0

Mine是通過刪除%LocalAppData%\ Temp \ Temporary ASP.NET Files \,但爲了提供問題的解釋,請+1。 – muglio

7

全部的路徑列表檢查和刪除:

%LocalAppData%\Temp\Temporary ASP.NET Files\ 
%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\ 
%SystemRoot%\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\ 
%SystemRoot%\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\ 
%SystemRoot%\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\