[VS2022錯誤訊息] Unable to locate the .NET SDK … global.json

2021/11/11閱讀時間約 3 分鐘
安裝 VS 2022以後,舊版VS2019 出現 .NET Core 5 / .NET Standard 2專案無法載入。
錯誤訊息 — The project file cannot be opened. Unable to locate the .NET SDK. Check that it is installed and that the version specified in global.json (if any) matches the installed version.
As all .NET developers I am quite excited by Visual Studio 2022 and .NET 6 going RTM. However I noticed that Visual Studio 2022 RTM install messed up Visual Studio 2019. Our .NET 5 and .NET Standard 2 projects couldn’t be loaded anymore in Visual Studio 2019. The error shown when attempting to load the projects was:
The project file cannot be opened. Unable to locate the .NET SDK. Check that it is installed and that the version specified in global.json (if any) matches the installed version.
Hamid Mosalla compiled solutions to this problem in a great post. However none of those solutions worked. After an hour googling and tweaking I found the solution here VS2022 RC Install messed up my Android Xamarin projects in VS2019. In your system environment variable path,
Visual Studio 2022 put C:\Program Files (x86)\dotnet\ before C:\Program Files\dotnet\. Just restore the right order et voilà 🙂
最後一個詞彙是「法文」,請看 最後一個詞彙是「法文」,請看 https://kknews.cc/zh-tw/news/vo6mp8l.html
第一,滑鼠點選「本機」,按下 滑鼠右鍵
第二,選擇 “進階系統設定” ,然後修改 “環境變數 (PATH) “
下圖第四點 (4) 的順序很重要!!
資料來源
相關影片
為什麼會看到廣告
    2會員
    113內容數
    留言0
    查看全部
    發表第一個留言支持創作者!