3

Yesterday my project was running smoothly but today I'm facing an error. Here are the details:

Could not load file or assembly 'file:///C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\parktms\c8392404\1ba3bab5\App_Web_login.aspx.6cc23264.lmj8uym6.dll' or one of its dependencies. The handle is invalid. (Exception from HRESULT: 0x80070006 (E_HANDLE)) 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 'file:///C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\parktms\c8392404\1ba3bab5\App_Web_login.aspx.6cc23264.lmj8uym6.dll' or one of its dependencies. The handle is invalid. (Exception from HRESULT: 0x80070006 (E_HANDLE))

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.

Stack Trace:

[FileLoadException: Could not load file or assembly 'file:///C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\parktms\c8392404\1ba3bab5\App_Web_login.aspx.6cc23264.lmj8uym6.dll' or one of its dependencies. The handle is invalid. (Exception from HRESULT: 0x80070006 (E_HANDLE))] System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0 System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +39 System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks) +132 System.Reflection.Assembly.Load(AssemblyName assemblyRef, Evidence assemblySecurity) +28 System.CodeDom.Compiler.CompilerResults.get_CompiledAssembly() +93 System.Web.Compilation.BuildProvider.CreateBuildResult(CompilerResults results) +65 System.Web.Compilation.TemplateControlBuildProvider.CreateBuildResult(CompilerResults results) +36 System.Web.Compilation.BuildProvider.GetBuildResult(CompilerResults results) +16 System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) +8967378 System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) +320 System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) +111 System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound) +125 System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp) +52 System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +31 System.Web.UI.PageHandlerFactory.System.Web.IHttpHandlerFactory2.GetHandler(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +40 System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) +167 System.Web.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +128 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184

Version Information:

Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.225

why am I having this problem and how do I get rid of it?

Mr Lister
  • 45,515
  • 15
  • 108
  • 150
skhurams
  • 2,133
  • 7
  • 45
  • 82

2 Answers2

17

Try performing a full solution build. If that doesn't work, click Build -> Clean Solution. If the error persists, delete everything in the C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\parktms folder and repeat.

Chris Gessler
  • 22,727
  • 7
  • 57
  • 83
  • thanks it worked but can you tell me what went wrong to avoid future mishaps – skhurams May 08 '12 at 10:42
  • The compiler was unable to copy one of the output files to the temp folder. File might have been in-use at time. Hard to say without seeing your build or system logs. – Chris Gessler May 08 '12 at 10:52
  • im using mygeneration in my project now its saying Error 1 The type or namespace name 'SqlClientEntity' could not be found (are you missing a using directive or an assembly reference?) E:\Projects\parkingticket\Projects Application\ParkTMS\App_Code\Generated\_vw_Tickets.cs 22 38 E:\...\ParkTMS\ while i have added doodads reference – skhurams May 08 '12 at 11:21
  • This might get you started... http://www.mygenerationsoftware.com/phpBB3/viewtopic.php?f=8&t=1104 – Chris Gessler May 08 '12 at 11:27
  • @ChrisGessler God I hope you're still active. Any suggestions about a WinForms WebSite and not a project. I do still have the Build Project and Build Website buttons (VS17, so no "Clearn") But the site is run off of IIS and is copied and not deployed ? – Иво Недев Mar 07 '18 at 15:29
  • The only thing "Clean Solution" does is delete the output files from the bin folder. You can do that step manually. – Chris Gessler Mar 14 '18 at 15:36
0

when you see it has temporary folder, then you should guess everything will be ok after clean and build

mahdi moghimi
  • 528
  • 1
  • 7
  • 20