C# 使用VS和DotNet 3.0编译问题时出现意外错误 ;CS0023

C# 使用VS和DotNet 3.0编译问题时出现意外错误 ;CS0023,c#,asp.net-mvc,visual-studio,.net-core,model-view-controller,C#,Asp.net Mvc,Visual Studio,.net Core,Model View Controller,我重构了一个应用程序,并从Core2.2升级到了3.0,在构建时,我突然收到了编译器错误CS0023代码 我以前从未见过这个问题,有人有解决办法吗 Error CS0023 Operator '!' cannot be applied to operand of type 'Task<bool>' .Web \Navigation\Default.cshtml 7 Active Error CS0029 Cannot implicitly convert t

我重构了一个应用程序,并从Core2.2升级到了3.0,在构建时,我突然收到了编译器错误CS0023代码

我以前从未见过这个问题,有人有解决办法吗

Error   CS0023  Operator '!' cannot be applied to operand of type 'Task<bool>'  .Web    \Navigation\Default.cshtml  7   Active
Error   CS0029  Cannot implicitly convert type 'System.Threading.Tasks.Task<bool>' to 'bool .Web    Navigation\SideNav.cshtml   2   Active
Error   CS0023  Operator '!' cannot be applied to operand of type 'Task<bool>'  .Web    \Components\Navigation\SideNav.cshtml   9   Active
Error   CS0023  Operator '!' cannot be applied to operand of type 'Task<bool>'  .Web    Shared\Components\Navigation\SideNav.cshtml 13  Active
Error   CS1977  Cannot use a lambda expression as an argument to a dynamically dispatched operation without first casting it to a delegate or expression tree type. .Web    \Details.cshtml 8   Active
Error   CS1973  'IHtmlHelper<dynamic>' has no applicable method named 'RenderPartialAsync' but appears to have an extension method by that name. Extension methods cannot be dynamically dispatched. Consider casting the dynamic arguments or calling the extension method without the extension method syntax.    .Web    Details.cshtml  132 Active
Error   CS1973  'IHtmlHelper<dynamic>' has no applicable method named 'RenderPartialAsync' but appears to have an extension method by that name. Extension methods cannot be dynamically dispatched. Consider casting the dynamic arguments or calling the extension method without the extension method syntax.    A.Web   Details.cshtml  171 Active
错误CS0023运算符'!'无法应用于“Task”类型的操作数。Web\Navigation\Default.cshtml 7处于活动状态
错误CS0029无法将类型“System.Threading.Tasks.Task”隐式转换为“bool.Web导航\SideNav.cshtml 2 Active”
错误CS0023运算符“!”无法应用于“Task”类型的操作数。Web\Components\Navigation\SideNav.cshtml 9处于活动状态
错误CS0023运算符“!”无法应用于“任务”类型的操作数。Web Shared\Components\Navigation\SideNav.cshtml 13处于活动状态
错误CS1977在未将lambda表达式强制转换为委托或表达式树类型之前,无法将lambda表达式用作动态调度操作的参数。Web\Details.cshtml 8处于活动状态
错误CS1973“IHtmlHelper”没有名为“RenderPartialAsync”的适用方法,但似乎有一个同名的扩展方法。无法动态调度扩展方法。考虑在不使用扩展方法语法的情况下强制转换动态参数或调用扩展方法。Web Details.cshtml 132处于活动状态
错误CS1973“IHtmlHelper”没有名为“RenderPartialAsync”的适用方法,但似乎有一个同名的扩展方法。无法动态调度扩展方法。考虑在不使用扩展方法语法的情况下强制转换动态参数或调用扩展方法。A.Web Details.cshtml 171处于活动状态

Hi,@devcraw。错误日志指出了错误发生的位置,您可以在以下位置检查代码并尝试解决问题:\Navigation\Default.cshtml文件的第7行。导航\SideNav.cshtml文件的第2行、第9行和第13行。Details.cshtml的第8行、第132行和第171行。如果有任何问题,请给我看相关问题的代码(我上面提到的代码)来分析问题。我找到了修复程序。您需要将false false添加到cs prog和.AddRazorRuntimeCompilation()中;到启动文件