Hi @Diana Moura , thanks for your reply and as I can't see your tutorial, I can only test in my side by creating a new dotnet 5 MVC project and deleting the ErrorViewModel.cs
file.
And certainly, there will be some error message if I press F5 to start the program, it showed that can't find ErrorViewModel in HomeController. So I comment the code in the controller which will return Error view.
Controller action which is related to ErrorViewModel, just comment it.
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
public IActionResult Error()
{
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
}
And then I press F5 to try to start again and I see the same error message in my side:
That comes from the _ViewImports.cshtml
file, just comment the using
code line.
@using DeleteErrorModel
@using DeleteErrorModel.Models
After comment that 2 lines, we need to modify Error.cshtml
finally. Removing or comment the @model
line and those codes which using model data.
Then press F5, and start the program successfully.
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Best Regards,
Tiny Wang