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 ?

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

Accepted answer
  1. Bruce (SqlWork.com) 56,531 Reputation points
    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