CentOS 7
Sponsored Link

.NET Core 3.0 インストール2020/01/20

 
Microsoft .NET Core 3.0 をインストールします。
[1] .NET Core 3.0 をインストールします。
[root@dlp ~]#
yum -y install deltarpm unzip zlib gettext libunwind libicu libcurl-devel openssl-devel libicu-devel
[root@dlp ~]#
rpm --import https://packages.microsoft.com/keys/microsoft.asc

[root@dlp ~]#
cat > /etc/yum.repos.d/dotnetdev.repo <<EOF
[packages-microsoft-com-prod]
name=packages-microsoft-com-prod
baseurl=https://packages.microsoft.com/yumrepos/microsoft-rhel7.3-prod
enabled=1
gpgcheck=1
gpgkey=https://packages.microsoft.com/keys/microsoft.asc
EOF
[root@dlp ~]#
yum -y install dotnet-sdk-3.0
[root@dlp ~]#
echo 'export PATH=$PATH:$HOME/dotnet' > /etc/profile.d/dotnetdev.sh

[root@dlp ~]#
source /etc/profile.d/dotnetdev.sh

[root@dlp ~]#
dotnet --version

3.0.102
[2] 任意の一般ユーザーで Hello World サンプルアプリケーションをテストします。
[cent@dlp ~]$
dotnet new console -o helloworld


Welcome to .NET Core 3.0!
---------------------
SDK Version: 3.0.102

Telemetry
---------
The .NET Core tools collect usage data in order to help us improve your experience. The data is anonymous. 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 Core CLI Tools telemetry: https://aka.ms/dotnet-cli-telemetry

----------------
Explore documentation: https://aka.ms/dotnet-docs
Report issues and find source on GitHub: https://github.com/dotnet/core
Find out what's new: https://aka.ms/dotnet-whats-new
Learn about the installed HTTPS developer cert: https://aka.ms/aspnet-core-https
Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli-docs
Write your first app: https://aka.ms/first-net-core-app
--------------------------------------------------------------------------------------
Getting ready...
The template "Console Application" was created successfully.

Processing post-creation actions...
Running 'dotnet restore' on helloworld/helloworld.csproj...
  Restore completed in 1.41 sec for /home/cent/helloworld/helloworld.csproj.

Restore succeeded.

[cent@dlp ~]$
cd helloworld

[cent@dlp helloworld]$
dotnet run

Hello World!
[3] 任意の一般ユーザーで ASP.NET Core Web App サンプルアプリケーションをテストします。
[cent@dlp ~]$
dotnet new razor -o asp.net

The template "ASP.NET Core Web App" was created successfully.
This template contains technologies from parties other than Microsoft, see https://aka.ms/aspnetcore/3.0-third-party-notices for details.

Processing post-creation actions...
Running 'dotnet restore' on asp.net/asp.net.csproj...
  Restore completed in 79.08 ms for /home/cent/asp.net/asp.net.csproj.

Restore succeeded.

[cent@dlp ~]$
cd asp.net

[cent@dlp asp.net]$
dotnet run

.....
.....
info: Microsoft.Hosting.Lifetime[0]
      Now listening on: http://localhost: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/cent/asp.net
  [http://localhost:5000] にアクセスすると以下のようなページが表示されます。
関連コンテンツ