简体   繁体   English

运行时编辑cshtml时,asp.net Core崩溃

[英]Asp.net Core crashes when editing cshtml while running

I'm getting 我越来越

MissingMethodException: Method not found: 'Microsoft.Cci.IMethodReference Microsoft.Cci.ICustomAttribute.Constructor(Microsoft.CodeAnalysis.Emit.EmitContext)'. MissingMethodException:找不到方法:“ Microsoft.Cci.IMethodReference Microsoft.Cci.ICustomAttribute.Constructor(Microsoft.CodeAnalysis.Emit.EmitContext)”。

when trying to edit a cshtml file while ASP.NET Core solution is running. 在ASP.NET Core解决方案运行时尝试编辑cshtml文件时。

How to get the error: 如何获得错误:

  1. Run solution 运行解决方案
  2. Edit cshtml file 编辑cshtml文件
  3. Go to link where cshtml is showed 转到显示cshtml的链接
  4. Error is showing 显示错误

I have Visual Studio Professional 2017 version 15.9.4 我有Visual Studio Professional 2017版本15.9.4

.NET Core version is 2.1 .NET Core版本为2.1

The culprit for me was a reference to Microsoft.CodeAnalysis.Common v2.10.0 in the web project. 对我而言,罪魁祸首是对该Web项目中Microsoft.CodeAnalysis.Common v2.10.0的引用。 Downgrading that reference to v2.8.0 should fix it. 将该参考降级到v2.8.0应该可以解决。

Make sure that all nuGet packages is supported with 'Asp Net Core'. 确保“ Asp Net Core”支持所有nuGet软件包。 Uninstalling packages with only .Net support did the trick for me. 仅支持.Net的软件包卸载对我有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM