Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not load file or assembly 'Microsoft.VisualStudio.Web.PageInspector.Loader

 Could not load file or assembly 'Microsoft.VisualStudio.Web.PageInspector.Loader, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The module was expected to contain an assembly manifest.   Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll Running under executable  C:\Program Files (x86)\Common Files\Microsoft Shared\DevServer\11.0\WebDev.WebServer40.exe --- A detailed error log follows.   === Pre-bind state information === LOG: User = TTLWIN2K\miralp LOG: DisplayName = Microsoft.VisualStudio.Web.PageInspector.Loader, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a  (Fully-specified) LOG: Appbase = file:///C:/SVN/temp/components/src/MasterpassProxy/src/Webservice/ LOG: Initial PrivatePath = C:\SVN\temp\components\src\MasterpassProxy\src\Webservice\bin Calling assembly : (Unknown). === LOG: This bind starts in default load context. LOG: Using application configuration file: C:\SVN\temp\components\src\MasterpassProxy\src\Webservice\web.config LOG: Using host configuration file:  LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config. LOG: Post-policy reference: Microsoft.VisualStudio.Web.PageInspector.Loader, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 
like image 765
Miral Avatar asked Feb 17 '14 12:02

Miral


People also ask

Can not load file or assembly?

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 or assembly Publickeytoken null or one of its dependencies?

This error usually means that the assembly was not found. Try verifying that the file exists in the directory where your application is running.


2 Answers

No need to remove those lines
Just close and reopen the Visual studio with Admin privileges.

like image 45
user6228795 Avatar answered Sep 18 '22 12:09

user6228795


I just ran into the same problem, and the culprit was my uninstalling of Visual Studio Express 2012. It's possible that it might be any version of Visual Studio, as comments on this answer are indicating the issue still happens with Visual Studio 2019. My overall order of operations was:

  • Installed Visual Studio Express 2012 (long time ago)
  • Used Visual Studio Express 2012 happily for many months
  • Installed Visual Studio 2013 Premium
  • Used Visual Studio 2013 Premium happily for weeks
  • Uninstalled Visual Studio Express 2012
  • ERROR

I'm not 100% certain on the cause of it, or what combinations of Visual Studio versions would exhibit this behavior. But the solution for me was to edit the root web.config files in the framework directories:

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\web.config 

(For different framework versions you may have different folders.)

And remove the nodes:

<remove assembly="Microsoft.VisualStudio.Web.PageInspector.Loader, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <add assembly="Microsoft.VisualStudio.Web.PageInspector.Loader, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> 

Be careful not to remove any opening/closing parent nodes which are also on the same line(s) as these.

This resolved the issue for me.

like image 99
David Avatar answered Sep 16 '22 12:09

David