I want write "Hello World" with ASP.NET Core

Abdurrahman KAYA 40 Reputation points
2024-04-06T09:10:18.8033333+00:00

I want write "Hello World" with ASP.NET Core. Can you help me ?

Developer technologies | ASP.NET | ASP.NET Core
0 comments No comments
{count} votes

Accepted answer
  1. Bruce (SqlWork.com) 78,161 Reputation points Volunteer Moderator
    2024-04-06T19:05:36.83+00:00

    its pretty easy:

    mkdir webhello
    cd webhello
    dotnet new web
    dotnet run
    

    you will end up with a program.cs that looks like:

    var builder = WebApplication.CreateBuilder(args);
    var app = builder.Build();
    
    app.MapGet("/", () => "Hello World!");
    
    app.Run();
    

    and a webhello.csproj that looks like:

    <Project Sdk="Microsoft.NET.Sdk.Web">
      <PropertyGroup>
        <TargetFramework>net8.0</TargetFramework>
        <Nullable>enable</Nullable>
        <ImplicitUsings>enable</ImplicitUsings>
      </PropertyGroup>
    </Project>
    
    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.