[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.

 

引述 –  https://blog.ndepend.com/visual-studio-2022-messing-up-visual-studio-2019/

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) 的順序很重要!!

 

資料來源

https://hamidmosalla.com/2021/03/13/unable-to-locate-the-net-sdk-the-reasons/

https://blog.ndepend.com/visual-studio-2022-messing-up-visual-studio-2019/

 

相關影片  

 

 

我將思想傳授他人, 他人之所得,亦無損於我之所有;

猶如一人以我的燭火點燭,光亮與他同在,我卻不因此身處黑暗。----Thomas Jefferson

線上課程教學,遠距教學 (Web Form 約51hr)  https://dotblogs.com.tw/mis2000lab/2016/02/01/aspnet_online_learning_distance_education_VS2015

線上課程教學,遠距教學 (ASP.NET MVC 約75~88hr)  https://dotblogs.com.tw/mis2000lab/2018/08/14/ASPnet_MVC_Online_Learning_MIS2000Lab

ASP.NET MVC線上課程 第一天 免費看 (5.5小時) 

寫信給我,不要私訊 --  mis2000lab (at) yahoo.com.台灣  或  school (at) mis2000lab.net


ASP.NET遠距教學、線上課程(Web Form + MVC)。 第一天課程, "完整" 試聽。 

................   facebook社團   https://www.facebook.com/mis2000lab   ......................

................  YouTube (ASP.NET) 線上教學影片  https://www.youtube.com/channel/UC6IPPf6tvsNG8zX3u1LddvA/

 

Blog文章 "附的範例" 無法下載,請看 這裡 ...... https://dotblogs.com.tw/mis2000lab/2016/03/14/2008_2015_mis2000lab_sample_download

請看我們的「售後服務」範圍(嚴格認定)。

...................................................................................................................................................... 

[遠距教學、教學影片] ASP.NET (Web Form) 課程 上線了!MIS2000Lab.主講

事先錄製好的影片,並非上課時側錄!   觀看影片時,有如我「一對一」跟您面對面講課

 

ASP.NET MVC 5 => .NET Core MVC 線上教學

         累積時數約 95小時...... 第一天(5.5小時)完整內容,"免費"讓您評估