未处理的异常:system.io.file load exception:无法加载文件或程序集“ 。。。。 找到的程序集的清单定义与程序集引用不匹配。
问题描述: 添加控制器的时候,突然就报了这个错: Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'C:\Users\.nuget\packages\microsoft.visualstudio.web.codegeneration.design\3.1.0-preview1-19509-03\lib\netstandard2.0\dotnet-aspnet-codegenerator-design.dll'. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) 前几天一直都正常的,我检查了配置和nuget包完全是匹配的,一脸懵逼。 1、项目用的是.net core 2.2 ,我觉得应该是版本的问题,以前Microsoft.VisualStudio.Web.CodeGeneration.Design 应该是2.2.4的版本,不知道为啥现在是3.1.0了,然后就降低了版本到2.2.4,然而还是一样的错。 2、之后把Microsoft.VisualStudio.Web