0

I ran into a strange problem in my project.

This problem occurs when I want to return a specific razor view inside a method. But the point is that this problem only happens when I have used tag helpers like asp-for, otherwise there is no problem.

Error Page screenshot

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Taqi ツ
  • 61
  • 7
  • There's a similar issue on github:https://github.com/dotnet/ef6/issues/382 hope it could help – Ruikai Feng Aug 18 '22 at 01:47
  • please make sure that you referenced all the necessary usings for your view, if you are not using view import, you should include these usings in all of your views `@using EFCoreTraining2` `@using EFCoreTraining2.Models` `@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers` – Mamink Aug 18 '22 at 09:21

1 Answers1

0
  • First you should update your Visual Studio's installation. You can't run the latest ASP.NET core apps with the older versions. It's explained here. Take a look at its The Visual Studio / .NET Core SDK support matrix to see what's the real problem.
  • Also follow this thread: https://stackoverflow.com/a/44723132/298573
VahidN
  • 18,457
  • 8
  • 73
  • 117
  • Thank you I found the problem There was only one wrong 'using' – Taqi ツ Aug 18 '22 at 18:33
  • Was that error message helpful to solve the problem? No! Will you see such a message if you run your app directly using the `dotnet watch run` command? No! How about using other IDE's which are not tied to the MSBuild? No! – VahidN Aug 19 '22 at 06:26