程序集的清单定义与程序集引用不匹配

编程入门 行业动态 更新时间:2024-10-24 00:18:58
本文介绍了程序集的清单定义与程序集引用不匹配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我更新了我的 MVC 项目的所有包,但出现以下错误:

I updated all the packages of my MVC project and I got the following error:

无法加载文件或程序集Antlr3.Runtime,版本=3.5.0.2,Culture=neutral, PublicKeyToken=eb42632606e9261f' 或其中之一依赖关系.定位的程序集的清单定义没有匹配程序集引用.(来自 HRESULT 的异常:0x80131040)

Could not load file or assembly 'Antlr3.Runtime, Version=3.5.0.2, Culture=neutral, PublicKeyToken=eb42632606e9261f' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

在打开 razor (.cshtml) 文件的情况下构建项目给了我更多错误

Building the project with a razor (.cshtml) file open gave me more errors

推荐答案

这是我设法解决它的方法:

Here's how I managed to solve it:

转到解决方案资源管理器并在参考下选择 Antlr,右键单击并说出属性.确保文件版本与编译器要查找的文件版本相同.就我而言,MSBuild 需要 5.5.0.2 版,但参考属性显示的是早期的 2.x 版本.

Go to the solution explorer and choose Antlr under References, right-click and say properties. Make sure the file version is the same the compiler is looking for. In my case, MSBuild wanted version 5.5.0.2, but the reference properties showed an earlier 2.x version.

我所要做的就是转到包管理器控制台并输入:

All I had to do is go to the package manager console and type:

PM> update-package Antlr

然后再次构建项目,如果您对更多程序集出现相同的错误,也请更新它们.您的问题将得到解决

Then build the project again, and in-case you get the same error for more assemblies, update them as well. Your issue will be resolved

更多推荐

程序集的清单定义与程序集引用不匹配

本文发布于:2023-11-03 16:10:45,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1555537.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:程序   清单   不匹配   定义

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!