Share via

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 Core | Other
0 comments No comments

Answer accepted by question author

Bruce (SqlWork.com) 84,071 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>

Was this answer helpful?

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' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.