Try  HackMD Logo HackMD

安裝WSL

https://hackmd.io/9QPpKRnETMOAVO9EJXHC_Q

啟動Ubuntu:23.10

docker run -it --rm ubuntu:23.10

https://learn.microsoft.com/zh-tw/dotnet/core/install/linux-ubuntu-2310

安裝相關套件

apt-get update
apt-get install wget 
apt-get install vim
apt-get install build-essential
apt-get install libicu-dev
# mac brew tap isen-ng/dotnet-sdk-versions brew install --cask dotnet-sdk8-0-100 # x64 apt-get update && \ apt-get install -y dotnet-sdk-8.0 # arm64 wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh chmod +x ./dotnet-install.sh ./dotnet-install.sh --version latest

設定環境變數.bashrc

export DOTNET_ROOT=$HOME/.dotnet
export PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools

套用環境變數

source .bashrc

建立專案

https://learn.microsoft.com/zh-tw/dotnet/core/tools/dotnet-new-sdk-templates

dotnet dev-certs https --clean
dotnet dev-certs https --trust
dotnet new list
dotnet new webapi --use-controllers --no-https -o w1
cd w1
dotnet watch