Skip to main content
ProductsDesktop toolsTASTECADDrawing reviewTASTEFILESFile managementTASTEFTPFile transferTASTESSHRemote workspaceTASTEZIPCompression and extractionTASTEWINMFile managementDeveloper toolsTASTECODERust integrated development environmentTASTESTUDIOIntegrated development and test environmentTASTEETLData integration (ETL)ServersTASTEREMOTERemote desktop serverTASTEGEOGeospatial serverTASTEMAILMail workspaceInvestingTASTESTOCKStock auto-trading desktop appGet startedDownloadsDocumentationBuyAll products
Marketplace
News
TechNewsToday's dev newsDeveloper docsProgramming languagesRustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDartWeb front-end frameworksNext.jsReactVue.js · NuxtSvelteKitAngularServer frameworksSpring BootDjangoFastAPIASP.NET CoreNestJS · ExpressApp & desktop frameworksTauriFlutterReact NativeElectronAlgorithmsAlgorithm basicsCore algorithmsAdvanced algorithmsPractical algorithms
CommunityProjectsDevelopment logsPromptsAI tool issuesShowcaseCommunity guide
Work with usTech transferWebsite buildDesktop app buildRelease and payment pipelineSales partnerContact
ServicesRemote desktopCustom installer packages
TASTEDEV
Products

Desktop tools

TASTECADComplex drawings, opened with easeTASTEFILESJust the files you need, as fast as possibleTASTEFTPThe tidiest path for your filesTASTESSHA stronger link between you and your serversTASTEZIPPack faster, unpack saferTASTEWINMA keyboard-first file manager with two panes

Developer tools

TASTECODEEdit, build, debug and test Rust apps in one windowTASTESTUDIOFrom editing to remote tests and approved AI fixesTASTEETLMove data while you watch the values

Servers

TASTEREMOTEA remote desktop you run on your own serverTASTEGEORebuilding a GeoServer-compatible geospatial server in RustTASTEMAILTake back control of your email

Investing

TASTESTOCKStock auto-trading that follows the rules you set: when, and what

Get started

DownloadsLatest builds of every productDocsHow to use each productBuySubscriptions and perpetual licencesAll productsEvery product at a glance
All products
MarketplaceNews
Tech

News

Today's dev newsOfficial announcements on languages, frameworks, GitHub and AIDeveloper docsGuides to languages, frameworks and algorithms

Programming languages

RustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDart

Frameworks

Web front-end frameworksNext.jsReactVue.js · NuxtSvelteKitAngular
Server frameworksSpring BootDjangoFastAPIASP.NET CoreNestJS · Express
App & desktop frameworksTauriFlutterReact NativeElectron

Algorithms

Algorithm basicsComplexity analysis · Sorting · Searching · Basic data structures · Trees and heapsCore algorithmsGraph traversal · Shortest paths & minimum spanning trees · Dynamic programming · Greedy algorithms · Divide and conquer · BacktrackingAdvanced algorithmsString algorithms · Math and number theory · Bit manipulation · Segment trees · Union-findPractical algorithmsCoding interview strategy · LRU cache · Rate limiting · Consistent hashing
All development docs
Community
ProjectsDiscover builders and their workDevelopment logsDecisions and lessons learnedPromptsReusable instructionsAI tool issuesProblems and workarounds for Claude, Codex, GeminiShowcaseFinished resultsCommunity guideHow we build in the open
Work with us
Tech transferNative apps in Rust and eguiWebsite build10 languages, accounts, docs and downloadsDesktop app buildRust and egui, no WebViewRelease and payment pipelineSigning, MSI, deb, rpm, AppImage, hashesSales partnerRecommend us and earn 30%ContactBuilds, partnerships and investment
Services
Remote desktopReach your computer from a browserCustom installer packagesOnly the features you need, settings preloaded
Buy
EN
한국어EnglishDeutschEspañolFrançaisItalianoPortuguês (Brasil)日本語简体中文繁體中文
Log in
Log in
TASTEDEV

From small tools to better development.

support@tastedev.netSupport TASTEDEV
ProductsProduct lineupBuyDocsDownloadsMarketplaceSupport
CommunityProjectsDevelopment logsPromptsAI tool issuesShowcase
PoliciesAbout usPrivacy policyTerms of serviceSubscription termsRefund policyCommunity guidelines
AccountLog inSign up
Visitors
Today
Yesterday
Total views
Company
GXSOFT
Representative
CHOI YOUNG GU
Business registration number
853-44-00368
Address
9F V24, 351 Gyeongin-ro, Michuhol-gu, Incheon, Republic of Korea
Phone
+82-10-4404-1523
Email
whitecalvin@tastedev.net
Privacy officer
CHOI YOUNG GU

© 2026 TASTEDEVProduct information is based on verified development sources.Released · improving

ASP.NET Core docs
ASP.NET Core
Getting Started with ASP.NET CoreProject Structure and ConfigurationCore ConceptsData, Validation and AuthenticationTestingDeployment
Discussions

ASP.NET Core guide · 2/6

Project Structure and Configuration

This chapter walks through the files of a new project, explains how configuration and environments work, and shows common ways to organize code as the app grows.

Files in a new project

dotnet new webapi -o TodoApi produces:

TodoApi/
├── Program.cs
├── TodoApi.csproj
├── TodoApi.http
├── appsettings.json
├── appsettings.Development.json
├── Properties/
│   └── launchSettings.json
├── bin/
└── obj/
FilePurpose
Program.csEntry point: registers services and builds the request pipeline
TodoApi.csprojProject file: SDK, target framework, NuGet packages
appsettings*.jsonConfiguration, with per-environment overrides
Properties/launchSettings.jsonLocal launch profiles for dotnet run and IDEs
TodoApi.httpSample HTTP requests to send from the editor
bin/, obj/Build output; keep them out of source control

The project file

<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <TargetFramework>net10.0</TargetFramework>
    <Nullable>enable</Nullable>
    <ImplicitUsings>enable</ImplicitUsings>
  </PropertyGroup>

</Project>

Microsoft.NET.Sdk.Web makes this an ASP.NET Core project: it references the shared ASP.NET Core framework and adds web-specific implicit usings. TargetFramework follows the SDK that created the project. Packages are added with the CLI, which writes a PackageReference into this file:

dotnet add package Microsoft.EntityFrameworkCore.Sqlite
dotnet list package

Program.cs in two halves

Every Program.cs has the same shape: register services on the builder, then build the app and describe the pipeline. Services must be registered before Build(); after that the container is read-only.

var builder = WebApplication.CreateBuilder(args);

// 1. Services for the dependency injection container
builder.Services.AddOpenApi();

var app = builder.Build();

// 2. Middleware pipeline and endpoints
if (app.Environment.IsDevelopment())
{
    app.MapOpenApi();
}

app.UseHttpsRedirection();
app.MapGet("/health", () => "ok");

app.Run();

appsettings.json and environments

{
  "Logging": {
    "LogLevel": {
      "Default": "Information",
      "Microsoft.AspNetCore": "Warning"
    }
  },
  "AllowedHosts": "*",
  "ConnectionStrings": {
    "Default": "Data Source=todo.db"
  },
  "Todo": {
    "PageSize": 20
  }
}

The environment name comes from ASPNETCORE_ENVIRONMENT (or DOTNET_ENVIRONMENT). Typical values are Development, Staging and Production; when nothing is set, the app runs as Production. appsettings.{Environment}.json is layered on top of appsettings.json, so it only needs the keys that differ.

The default builder reads configuration in this order, and later sources win:

  1. appsettings.json
  2. appsettings.{Environment}.json
  3. User secrets (in Development only)
  4. Environment variables
  5. Command-line arguments

Nested keys use : in code and on the command line, and __ (double underscore) in environment variables:

export ASPNETCORE_ENVIRONMENT=Staging
export Todo__PageSize=50
dotnet run

# or pass the value as an argument to the app
dotnet run -- --Todo:PageSize=50

Keep secrets out of appsettings.json. During development, the Secret Manager stores them outside the project folder:

dotnet user-secrets init
dotnet user-secrets set "ConnectionStrings:Default" "Host=localhost;Database=todo;Username=dev;Password=dev"

Properties/launchSettings.json holds the local profiles (URLs and environment variables such as ASPNETCORE_ENVIRONMENT=Development). It is used only by dotnet run and IDEs and is not part of the published output, so production settings belong in environment variables or configuration files.

Organizing a growing app

ASP.NET Core does not enforce a folder layout. Common conventions:

  • Endpoints/ or Controllers/: the HTTP surface, grouped by feature
  • Services/: business logic registered in DI
  • Data/: the EF Core DbContext and its Migrations/
  • Models/ or Contracts/: entities and request/response types
  • wwwroot/: static files served by the static file middleware

Larger solutions put the app under src/ and tests under tests/, tied together by a solution file (dotnet new sln, then dotnet sln add). Feature endpoints are often moved out of Program.cs into extension methods:

// Endpoints/TodoEndpoints.cs
public static class TodoEndpoints
{
    public static RouteGroupBuilder MapTodoEndpoints(this IEndpointRouteBuilder app)
    {
        var group = app.MapGroup("/todos");
        group.MapGet("/", () => Array.Empty<string>());
        return group;
    }
}

// Program.cs
app.MapTodoEndpoints();

Summary

  • Program.cs registers services, then builds the middleware pipeline and endpoints.
  • The .csproj file uses the Web SDK; packages come from dotnet add package.
  • Configuration layers JSON files, user secrets, environment variables and arguments; the environment name selects appsettings.{Environment}.json.
  • Folder layout is a team convention; extension methods keep Program.cs short.
Questions about this chapter?
Previous chapterGetting Started with ASP.NET CoreNext chapterCore Concepts

0 comments

Top commentsNewest first

Sign in · Sign in to leave a comment.