Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Page Inspector Assembly not found

I have a ASP MVC Project which I didn't make but I need to upload it on a IIS server. This works but when I upload it and visit the website I get this error:

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 system cannot find the file specified.

Everything works locally but not on the server. Things I tried already:

  • Repairing .NET Framework
  • Trying to remove 2 lines from .NET Framework webconfig (Located in: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config) file but can't because file is in use. Can't stop process because of Access Denied error

I found that removing these 2 lines might be a solution but I can't remove them:

<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" />

Is there something I am missing? Any help is much appreciated! Thx

like image 869
Nanou Ponette Avatar asked Apr 28 '15 10:04

Nanou Ponette


1 Answers

Try adding just this line to your site web.config. The config files are inherited from the .NET base up to you site and then folders in your site. So Your site will override the .NET framework config.

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

EDIT

The line should go here...

<configuration>
   <system.web>
      <compilation>
         <assemblies>
            <remove assembly="Microsoft.VisualStudio.Web.PageInspector.Loader, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
         </assemblies>
      </compilation>
   </system.web>
</configuration>

It should be noted that all that junk in the assembly attribute more than likely needs to be identical to the one that adds it in the .NET framework config.

like image 56
Michael Coxon Avatar answered Nov 16 '22 10:11

Michael Coxon