2021-11-11|閱讀時間 ‧ 約 4 分鐘

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

    安裝 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 . However none of those solutions worked. After an hour googling and tweaking I found the solution here . 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à 🙂
    最後一個詞彙是「法文」,請看 最後一個詞彙是「法文」,請看
    第一,滑鼠點選「本機」,按下 滑鼠右鍵
    第二,選擇 “進階系統設定” ,然後修改 “環境變數 (PATH) “
    下圖第四點 (4) 的順序很重要!!
    資料來源
    相關影片
    分享至
    成為作者繼續創作的動力吧!
    © 2024 vocus All rights reserved.