将@addTagHelper添加到* .cshtml文件后.显示错误500 [英] after adding @addTagHelper to the *.cshtml file. error 500 is shown

查看:159
本文介绍了将@addTagHelper添加到* .cshtml文件后.显示错误500的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用

@addTagHelper "*, Microsoft.AspNet.Mvc.TagHelpers"

在我的.cshtml文件中,它会导致错误500.但它在另一个ViewComponent中可以工作

in My .cshtml file it causes error 500. but it's work in another ViewComponent

推荐答案

我遇到了同样的问题,无法找出确切的原因.但是,将我的json文件中的"Microsoft.AspNet.Mvc.TagHelpers"依赖关系从"6.0.0-betaX"更改为"6.0.0-rc1-final"可以解决此问题.确保更改后恢复软件包.

I had the same problem and couldn't figure out the exact cause. However, changing the "Microsoft.AspNet.Mvc.TagHelpers" depencency in my json file from "6.0.0-betaX" to "6.0.0-rc1-final" fixed the issue. Make sure to restore packages after this change.

也:根据建议,@ TagHelper语句应转到您的_viewImports.cshtml文件.

Also: as suggested the @TagHelper statement should go to your _viewImports.cshtml file.

这篇关于将@addTagHelper添加到* .cshtml文件后.显示错误500的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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