ASP .NET error

Simone Marchetti 21 Reputation points
2021-08-04T07:42:22.513+00:00

Hi,
I'm starting to work with asp .net and mvc structure. I have this problem when open .cshtml file:
120435-cshtmlerror.png

@默 and @azzedinehtmlsql : don't exist in current contest. Why??

I'm working with VS2019 and .NET Core 5.0.

Thank you

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,235 questions
0 comments No comments
{count} votes

Accepted answer
  1. Zhi Lv - MSFT 32,036 Reputation points Microsoft Vendor
    2021-08-05T07:56:47.49+00:00

    Hi @Simone Marchetti ,

    You could try to use the following methods:

    1. Right click the Project, choose "Clean" option first, then "Rebuild" the project.
    2. Close the VS 2019 first, then re-open the project.
    3. Try to use Scaffolding to add the View.
      In the Controller action method, right click and choose the "Add View" option, then choose the Razor page with strongly-type Model, the screenshot as below:
      120764-1.gif

    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,
    Dillion

    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Simone Marchetti 21 Reputation points
    2021-08-05T12:10:22.257+00:00

    It works! Thank you for your help.
    I have another question.
    Why can't I add a class (or other object) when a I click on add->new element? I can add few object.
    120795-addnewelement.png

    Can you help me?

    Thank you


  2. Simone Marchetti 21 Reputation points
    2021-08-06T08:45:40.847+00:00

    Thank you. I'll create a new thread.

    0 comments No comments