1. 更新brew
➜ ~ brew update
2. 透過brew安裝openssl
➜ ~ brew install openssl
3. link openssl
➜ ~ brew link --force openssl
4. 移除之前的版本, 執行sh檔案內容請參考
(https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0/scripts/obtain/uninstall/dotnet-uninstall-pkgs.sh), 這邊我選擇使用vim新增一個sh檔案並把內容複製到檔案內.
➜ ~ vim dotnet-uninstall-pkgs.sh
5.賦予可執行權限
➜ ~ chmod +x dotnet-uninstall-pkgs.sh
6. 執行
➜ ~ sudo sh dotnet-uninstall-pkgs.sh
Deleting install root - /usr/local/share/dotnet
rm: /usr/local/share/dotnet: No such file or directory
rm: /etc/paths.d/dotnet: No such file or directory
dotnet packages removal succeeded.
7. 下載pkg檔案並且安裝
https://go.microsoft.com/fwlink/?LinkID=798400




8. 建立Helloword專案
➜ mkdir hwapp
➜ cd hwapp
➜ hwapp dotnet new

9. 恢復project.json
➜ hwapp dotnet restore

10. 編譯並執行
➜ hwapp dotnet run

真的有輸出「Hello World」!, 既然如此順便看看編譯後的專案結構與專案原始碼

看起來與原本Windows一樣有bin & obj 資料夾, 原始碼看起來也是與原本.NET環境下相同, 順便看看bin資料夾下有什麼東東...

真的有hwapp.dll檔案~
雖然覺得微軟進入的比較晚, 但也算是重大突破了!
Reference:
https://www.microsoft.com/net/core#macosx
沒有留言:
張貼留言