如何修复错误“无法加载文件或程序集“Microsoft.VisualStudio.Web"在 Visual Studio 2015 中? [英] How to fix error "Could not load file or assembly 'Microsoft.VisualStudio.Web" in Visual Studio 2015?

查看:68
本文介绍了如何修复错误“无法加载文件或程序集“Microsoft.VisualStudio.Web"在 Visual Studio 2015 中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在处理一个项目,而该项目运行良好.

I'm working on a project while the project is working fine.

但是在重新安装 Visual Studio 后,我的项目没有加载.

But after re-installed the Visual Studio my project is not loading.

出现此错误:

D:\UOSGC\Final\Banquet_Events_System\UI\UI.csproj :

D:\UOSGC\Final\Banquet_Events_System\UI\UI.csproj :

错误:无法加载文件或程序集Microsoft.VisualStudio.Web,版本=14.0.0.0,文化=中性,PublicKeyToken=b03f5f7f11d50a3a"或其依赖项之一.文件或目录已损坏且无法读取.(来自 HRESULT 的异常:0x80070570)

error : Could not load file or assembly 'Microsoft.VisualStudio.Web, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The file or directory is corrupted and unreadable. (Exception from HRESULT: 0x80070570)

错误截图为:

我的操作系统是 Windows 10 Professional,我使用的是 Visual Studio 2015.

My operating system is Windows 10 Professional and I'm using Visual Studio 2015.

文件或目录已损坏且无法读取

The file or directory is corrupted and unreadable

任何帮助将不胜感激!

推荐答案

解决这个问题可能需要多个步骤/事情:

There can be multiple steps / things you have to do for solving this issue:

第 1 步:首先检查 C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\web.config

Step 1: First Check C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\web.config

它看起来在下面添加一行:

It looks to add a line under:

<system.web> (not the section under <location allowOverride="true">)
<compilation>
<assemblies>
.....

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

.....
</assemblies>

已经有一个 <remove .../>对于我的那个部分顶部的这个程序集,但添加在底部附近.只需评论此条目,它就会开始工作.或者,如果您不确定是否为所有网站删除它,您可以在您的网站 web.config 中添加相同的行,使用 remove 而不是 add.

There was already a <remove ... /> for this assembly at the top of that section for mine, but the add was near the bottom. Just comment this entry, and it should start working. Or if you are unsure about removing it for all websites, you could add the same line in your website web.config, with remove instead of add.

第 2 步:(如果您使用的是 VS 2019)重新安装AspNetDiagnosticPack.msi"可以解决问题.VS 2019 安装包的安装文件夹中会有一个文件.(不删除"安装包的复选框已激活*).

Step 2: (if you are using VS 2019) Reinstall "AspNetDiagnosticPack.msi" can solve the problem. There will be a file in the package installation folder of the VS 2019 Installation. (The checkbox for "not delete" install packages was activated*).

如果您没有这些软件包,那么离线安装可能会有所帮助.

If you don't have the packages, that maybe a offline installation helps.

就我而言,文件夹名为:Microsoft.VisualStudio.AspNetDiagnosticPack.Msi,version=16.0.12276.43788".

In my case the folder was named: "Microsoft.VisualStudio.AspNetDiagnosticPack.Msi,version=16.0.12276.43788".

右键单击AspNetDiagnosticPack";并选择修复".

Richt click on "AspNetDiagnosticPack" and select "repair".

第 3 步:你需要下载这个nozzy. 并执行它并选择修复.

Step 3: You need to download this MSI And execute it and select repair.

最后,如果上述任何步骤未能解决问题,您需要下载并安装此新的 Visual Studio 版本已解决此问题.

Finally, if any of above steps not solved the issue you need to download and install this new Visual Studio release in which this issue has been resolved.

这篇关于如何修复错误“无法加载文件或程序集“Microsoft.VisualStudio.Web"在 Visual Studio 2015 中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆