[[oktatas:programozás:csharp:dotnetcore|< .Net Core]]
====== .Net Core Web ======
* **Szerző:** Sallai András
* Copyright (c) 2021, Sallai András
* Szerkesztve: 2024
* Licenc: [[https://creativecommons.org/licenses/by-sa/4.0/|CC Attribution-Share Alike 4.0 International]]
* Web: https://szit.hu
===== Projekt =====
mkdir app01
cd app01
dotnet new mvc
Futtatás:
dotnet run
A kimenet a következőhöz hasonló lehet:
Building...
warn: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[35]
No XML encryptor configured. Key {8d08458a-c1a3-4573-b20b-307f86cb8628} may be persisted to storage in unencrypted form.
info: Microsoft.Hosting.Lifetime[14]
Now listening on: https://localhost:7258
info: Microsoft.Hosting.Lifetime[14]
Now listening on: http://localhost:5274
info: Microsoft.Hosting.Lifetime[0]
Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
Hosting environment: Development
info: Microsoft.Hosting.Lifetime[0]
Content root path: /home/janos/dev/app01/
A böngészőbe írjuk be:
* https://localhost:7258
===== Struktúra =====
app01/
|-bin/
|-Controllers/
|-Models/
|-obj/
|-Properties/
|-Views/
|-wwwroot/
|-app01.csproj
|-appsettings.Development.json
|-appsettings.json
`-Program.cs
===== Navigáció =====
A navitáció így
* Views/Shared/_Layout.cshtml
===== Weblapok =====
* Views/Home/Index.cshtml
* Views/Home/Privacy.cshtml