Skip to content

Error while running tutorial #5977

@Genox2038

Description

@Genox2038

Problem encountered on https://dotnet.microsoft.com/learn/aspnet/hello-world-tutorial/modify
Operating System: windows

Provide details about the problem you're experiencing. Include your operating system version, exact error message, code sample, and anything else that is relevant.

Hi running into error while trying the tutorial on Windows 10. I copied the code directly from tutorial and pasted and I get the following error when trying to run. This is my first dive into learning code so any help will be appreciated.

@page
@model IndexModel
@{
ViewData["Title"] = "Home page";
}

Hello, world!

The time on the server is @DateTime.Now

watch : Started
Building...
C:\Users\blong\myApp\myWebApp\Pages\Index.cshtml.cs(2,8): error CS1003: Syntax error, ',' expected [C:\Users\blong\myApp\myWebApp\myWebApp.csproj]
C:\Users\blong\myApp\myWebApp\Pages\Index.cshtml.cs(3,1): error CS1646: Keyword, identifier, or string expected after verbatim specifier: @ [C:\Users\blong\myApp\myWebApp\myWebApp.csproj]
C:\Users\blong\myApp\myWebApp\Pages\Index.cshtml.cs(4,13): error CS1002: ; expected [C:\Users\blong\myApp\myWebApp\myWebApp.csproj]
C:\Users\blong\myApp\myWebApp\Pages\Index.cshtml.cs(4,14): error CS1001: Identifier expected [C:\Users\blong\myApp\myWebApp\myWebApp.csproj]
C:\Users\blong\myApp\myWebApp\Pages\Index.cshtml.cs(4,23): error CS1525: Invalid expression term '=' [C:\Users\blong\myApp\myWebApp\myWebApp.csproj]
C:\Users\blong\myApp\myWebApp\Pages\Index.cshtml.cs(5,1): error CS1022: Type or namespace definition, or end-of-file expected [C:\Users\blong\myApp\myWebApp\myWebApp.csproj]
C:\Users\blong\myApp\myWebApp\Pages\Index.cshtml.cs(5,2): error CS1525: Invalid expression term '<' [C:\Users\blong\myApp\myWebApp\myWebApp.csproj]
C:\Users\blong\myApp\myWebApp\Pages\Index.cshtml.cs(7,6): error CS1002: ; expected [C:\Users\blong\myApp\myWebApp\myWebApp.csproj]
C:\Users\blong\myApp\myWebApp\Pages\Index.cshtml.cs(7,11): error CS1001: Identifier expected [C:\Users\blong\myApp\myWebApp\myWebApp.csproj]
C:\Users\blong\myApp\myWebApp\Pages\Index.cshtml.cs(7,11): error CS1514: { expected [C:\Users\blong\myApp\myWebApp\myWebApp.csproj]
C:\Users\blong\myApp\myWebApp\Pages\Index.cshtml.cs(7,11): error CS1513: } expected [C:\Users\blong\myApp\myWebApp\myWebApp.csproj]
C:\Users\blong\myApp\myWebApp\Pages\Index.cshtml.cs(7,11): error CS8803: Top-level statements must precede namespace and type declarations. [C:\Users\blong\myApp\myWebApp\myWebApp.csproj]
C:\Users\blong\myApp\myWebApp\Pages\Index.cshtml.cs(7,11): error CS1525: Invalid expression term '=' [C:\Users\blong\myApp\myWebApp\myWebApp.csproj]
C:\Users\blong\myApp\myWebApp\Pages\Index.cshtml.cs(7,26): error CS1525: Invalid expression term '<' [C:\Users\blong\myApp\myWebApp\myWebApp.csproj]
C:\Users\blong\myApp\myWebApp\Pages\Index.cshtml.cs(8,14): error CS1002: ; expected [C:\Users\blong\myApp\myWebApp\myWebApp.csproj]
C:\Users\blong\myApp\myWebApp\Pages\Index.cshtml.cs(8,14): error CS1022: Type or namespace definition, or end-of-file expected [C:\Users\blong\myApp\myWebApp\myWebApp.csproj]
C:\Users\blong\myApp\myWebApp\Pages\Index.cshtml.cs(8,23): error CS1525: Invalid expression term '/' [C:\Users\blong\myApp\myWebApp\myWebApp.csproj]
C:\Users\blong\myApp\myWebApp\Pages\Index.cshtml.cs(8,27): error CS1525: Invalid expression term '<' [C:\Users\blong\myApp\myWebApp\myWebApp.csproj]
C:\Users\blong\myApp\myWebApp\Pages\Index.cshtml.cs(9,12): error CS1002: ; expected [C:\Users\blong\myApp\myWebApp\myWebApp.csproj]
C:\Users\blong\myApp\myWebApp\Pages\Index.cshtml.cs(9,20): error CS1003: Syntax error, ',' expected [C:\Users\blong\myApp\myWebApp\myWebApp.csproj]
C:\Users\blong\myApp\myWebApp\Pages\Index.cshtml.cs(10,7): error CS1002: ; expected [C:\Users\blong\myApp\myWebApp\myWebApp.csproj]

The build failed. Fix the build errors and run again.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-tutorialsIssues related to getting started tutorials

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions