Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Asp.net error Could not load file or assembly [duplicate]

Possible Duplicate:
After a computer crash my Visual Studio 2010 will not load an assembly

I have a web application in Asp.net MVC 3 developed in VS 2010. Today while working my laptop got rebooted due to some reason and from that time onward when I run my app from VS it gives me error

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

On googling I found few solutions

  1. Clean asp.net temp files
  2. Reinstall .net framework

I tried first solution but it didn't work. Before I try second solution I would like to know if there is any other alternative to fix this problem?

like image 785
pramodtech Avatar asked Jul 10 '11 13:07

pramodtech


People also ask

Can not load file or assembly?

Http 5.2. 0.0? In summary if you get the "Could not load file or assembly error", this means that either your projects or their references were built with a reference to a specific version of an assembly which is missing from your bin directory or GAC.

Could not load file assembly or one of its dependencies?

There are some workarounds for this issue: The dll file may not be in /bin folder. Just copy the dll file to /bin folder or set this preference Copy Local = True from Visual Studio. If the problem persists, check if the version of the assembly that is referenced is different than the version it is looking for.

Could not load file or assembly VS 2019?

Restart Visual Studio, clean and build a solution. Remove the class library references and add it again. Tools > Import and Export Settings Wizard > Reset all settings (maybe some setting was not well configured).


1 Answers

Delete all files from the following folders and try again:

C:\Users\[username]\AppData\Local\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\
like image 52
Alexander van Trijffel Avatar answered Oct 11 '22 02:10

Alexander van Trijffel