Search code examples
visual-studiovisual-studio-2022dotnet-sdk

Updating Visual Studio 2022 from 17.7 to 17.8 prevents building projects .NET 7


Why after I've updated Visual Studio 2022 from 17.7 to 17.8 projects targeting .NET 7 fail to build with message: Unable to resolve the .NET SDK version as specified in the global.json located at .\global.json

Has VS 2022 17.8 removed .NET 7 SDK?

Why on .NET SDK download page it says Using Visual Studio? This release is only compatible with Visual Studio 2022 (v17.7). ?

How can I build .NET 7 projects on VS 2022 17.8?


Solution

  • The SDK needs to be reinstalled.

    Download here: https://dotnet.microsoft.com/en-us/download/visual-studio-sdks

    We just ran into the same problem. It looks like this is by design. Although I found no reference to the behaviour. The Visual Studio Updater seems to uninstall old SDKs it installed itself, keeping only the most recent version. As it did not remove 7.0.404 for me, which I installed myself, but it removed 7.0.401, which I did not. So if you have not installed it yourself you are only left with 8.0.100. At least this is the behaviour I witnessed on other systems.

    So did others: https://developercommunity.visualstudio.com/t/Installintg-Visutal-Studio-178-removed/10521824?sort=newest