Could not load file or assembly '…' or one

2019-08-22 02:31发布

I'm working on a webforms project (3-tier) in Visual Studio Community 2015.

I've moved my project from one laptop to another and now the project is not running.

Note: Another Laptop has Visual Studio Professional 2015.

Showing blue underline under the first line of all pages as like this:

enter image description here

And this error:

enter image description here

I'm using Windows 10 Professional.

Any help will be appreciated!

1条回答
仙女界的扛把子
2楼-- · 2019-08-22 03:09

This error has nothing to do with your project. The file Microsoft.VisualStudio.Web.PageInspector.Loader is part of Visual Studio. Did the new laptop have different versions of Visual Studio (e.g. 2012) which have been removed? The easiest solution is to uninstall all versions of Visual Studio completely, reboot the machine, and then install the version that you want (e.g. Visual Studio 2015 Community).

Alternatively, you'll have to fix it by yourself. To do so, you have to modify the machine web.config file in these folders:

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

Open the web.config file in a text editor and search for all references to Microsoft.VisualStudio.Web.PageInspector.Loader and delete them. Then restart Visual Studio and run your project.

Another option is to modify the web.config in your project. This is not recommended, but it will work. Add the lines bellow:

<compilation> 
    <assemblies> 
        <remove assembly="Microsoft.VisualStudio.Web.PageInspector.Loader,
    Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    </assemblies> 
</compilation>
查看更多
登录 后发表回答