Debian 12 bookworm
Sponsored Link

.NET 7.0 : Install2023/12/15

 
Install .NET 7.0.
[1] Install .NET 7.0 and run helloworld sample app.
root@dlp:~#
wget https://packages.microsoft.com/keys/microsoft.asc -O /etc/apt/keyrings/microsoft.key

root@dlp:~#
wget https://packages.microsoft.com/config/debian/12/prod.list -O /etc/apt/sources.list.d/msprod.list
root@dlp:~#
vi /etc/apt/sources.list.d/msprod.list
# change like follows
deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/microsoft.key] https://packages.microsoft.com/debian/12/prod bookworm main

root@dlp:~#
apt update

root@dlp:~#
apt -y install dotnet-sdk-7.0 build-essential
root@dlp:~#
dotnet --version

7.0.404

# verify to create Hello World

root@dlp:~#
dotnet new console -o helloworld


Welcome to .NET 7.0!
---------------------
SDK Version: 7.0.404

Telemetry
---------
The .NET tools collect usage data in order to help us improve your experience. It is collected by Microsoft and shared with the community. You can opt-out of telemetry by setting the DOTNET_CLI_TELEMETRY_OPTOUT environment variable to '1' or 'true' using your favorite shell.

Read more about .NET CLI Tools telemetry: https://aka.ms/dotnet-cli-telemetry

----------------
Installed an ASP.NET Core HTTPS development certificate.
To trust the certificate run 'dotnet dev-certs https --trust' (Windows and macOS only).
Learn about HTTPS: https://aka.ms/dotnet-https
----------------
Write your first app: https://aka.ms/dotnet-hello-world
Find out what's new: https://aka.ms/dotnet-whats-new
Explore documentation: https://aka.ms/dotnet-docs
Report issues and find source on GitHub: https://github.com/dotnet/core
Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli
--------------------------------------------------------------------------------------
The template "Console App" was created successfully.

Processing post-creation actions...
Restoring /root/helloworld/helloworld.csproj:
  Determining projects to restore...
  Restored /root/helloworld/helloworld.csproj (in 66 ms).
Restore succeeded.

root@dlp:~#
cd helloworld

root@dlp:~/helloworld#
dotnet run

Hello, World!
[2] Try to create ASP.NET sample app with any common user.
debian@dlp:~$
dotnet new razor -o asp.net


Welcome to .NET 7.0!
---------------------
SDK Version: 7.0.404

Telemetry
---------
The .NET tools collect usage data in order to help us improve your experience. It is collected by Microsoft and shared with the community. You can opt-out of telemetry by setting the DOTNET_CLI_TELEMETRY_OPTOUT environment variable to '1' or 'true' using your favorite shell.

Read more about .NET CLI Tools telemetry: https://aka.ms/dotnet-cli-telemetry

----------------
Installed an ASP.NET Core HTTPS development certificate.
To trust the certificate run 'dotnet dev-certs https --trust' (Windows and macOS only).
Learn about HTTPS: https://aka.ms/dotnet-https
----------------
Write your first app: https://aka.ms/dotnet-hello-world
Find out what's new: https://aka.ms/dotnet-whats-new
Explore documentation: https://aka.ms/dotnet-docs
Report issues and find source on GitHub: https://github.com/dotnet/core
Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli
--------------------------------------------------------------------------------------
The template "ASP.NET Core Web App" was created successfully.
This template contains technologies from parties other than Microsoft, see https://aka.ms/aspnetcore/7.0-third-party-notices for details.

Processing post-creation actions...
Restoring /home/debian/asp.net/asp.net.csproj:
  Determining projects to restore...
  Restored /home/debian/asp.net/asp.net.csproj (in 68 ms).
Restore succeeded.

debian@dlp:~$
cd asp.net

debian@dlp:~/asp.net$
dotnet run --urls=http://10.0.0.30:5000/

Building...
warn: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[35]
      No XML encryptor configured. Key {d765f690-5acf-4345-8822-bacda41cf1a7} may be persisted to storage in unencrypted form.
info: Microsoft.Hosting.Lifetime[14]
      Now listening on: http://10.0.0.30:5000
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/debian/asp.net
  Access to the URL you set from any client computer, and then that's OK if following site is shown.
Matched Content