1. 概要
では、インストールから。
2. 何をインストールするか
「ports」を調べてみると。
cd /usr/ports/
make quicksearch name=dotnet
めぼしいものだけ、抜き書きしますが。
Port: dotnet8-8.0.6_4
Path: /usr/ports/lang/dotnet8
Info: Open-source developer platform and a cross-platform runtime for cloud, mobile, desktop, and IoT apps
Port: dotnet-9.0.6
Path: /usr/ports/lang/dotnet
Info: Open-source developer platform and a cross-platform runtime for cloud, mobile, desktop, and IoT apps
Port: lang/dotnet-runtime
Moved: lang/dotnet-host
Date: 2025-02-15
Reason: Rename to match Microsoft recommendations
ちゃんと、「.NET 8」「.NET 9」相当のものがあるようです。
せっかくなので、「.NET 9」の方をいれてみますか。
3. インストール
「pkg」ならば。
pkg install -y dotnet
ですな。
「ports」で、インストールします。
「root」ユーザ権限で。
cd /usr/ports/lang/dotnet
make config
オプションはありませんでした。
make NO_DIALOG=yes
この間、結構時間がかかるし、ディスク容量も消費するようです。
make install
インストール時のメッセージを記載します。
===> Installing for dotnet-9.0.6
===> Checking if dotnet is already installed
===> Registering installation for dotnet-9.0.6
Installing dotnet-9.0.6...
===> SECURITY REPORT:
This port has installed the following files which may act as network
servers and may therefore pose a remote security risk to the system.
/usr/local/share/dotnet/shared/Microsoft.NETCore.App/9.0.6/libmscordbi.so
/usr/local/share/dotnet/shared/Microsoft.NETCore.App/9.0.6/libcoreclr.so
/usr/local/share/dotnet/packs/Microsoft.NETCore.App.Host.freebsd.14-x64/9.0.6/runtimes/freebsd.14-x64/native/singlefilehost
If there are vulnerabilities in these programs there may be a security
risk to the system. FreeBSD makes no guarantee about the security of
ports included in the Ports Collection. Please type 'make deinstall'
to deinstall the port if this is a concern.
For more information, and contact details about the security
status of this software, see the following webpage:
https://dot.net
「make」時の途中の表示に。
DirSize After CleanupRepo command-line-api
Filesystem Size Used Avail Capacity Mounted on
zroot/ROOT/default 705G 248G 457G 35% /
DirSize After Building sdk
Filesystem Size Used Avail Capacity Mounted on
zroot/ROOT/default 705G 255G 450G 36% /
DirSize After CleanupRepo sdk
Filesystem Size Used Avail Capacity Mounted on
zroot/ROOT/default 705G 255G 450G 36% /
とかっていうのが表示されていたので、7GB ほど消費したのではないかと思います。
4. 確認
インストールした、バージョンや環境を確認します。
ここは、ログインユーザでも可。
dotnet --version
9.0.107
dotnet --info
.NET SDK:
Version: 9.0.107
Commit: 3b2a975be6
Workload version: 9.0.100-manifests.aae8e2eb
MSBuild version: 17.12.35+3b2a975be
ランタイム環境:
OS Name: FreeBSD
OS Version: 14
OS Platform: FreeBSD
RID: freebsd.14-x64
Base Path: /usr/local/share/dotnet/sdk/9.0.107/
インストール済みの .NET ワークロード:
表示するインストール済みワークロードはありません。
新しいマニフェストをインストールするときに loose manifests を使用するように構成されています。
Host:
Version: 9.0.6
Architecture: x64
Commit: 3b2a975be6
.NET SDKs installed:
9.0.107 [/usr/local/share/dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 9.0.6 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 9.0.6 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Other architectures found:
None
Environment variables:
Not set
global.json file:
Not found
Learn more:
https://aka.ms/dotnet/info
Download .NET:
https://aka.ms/dotnet/download
ん?これって、どうなんだろ?