[.NET MAUI] NETSDK1202 - 'net7.0-android' 워크로드는 지원되지 않으며 향후 보안 업데이트를 받지 않습니다. 오류 해결 방법
❌ 오류 발생, 원인
1월에 했던 MAUI 프로젝트를 열어봤는데, 오류가 발생했습니다.
시작 드롭다운 메뉴에 Android Emulator 옵션도 사라지고, 빌드는 계속 실패했습니다.
NETSDK1202 - 'net7.0-android' 워크로드는 지원되지 않으며 향후 보안 업데이트를 받지 않습니다.
지원 정책에 대한 자세한 내용은 https://aka.ms/maui-support-policy을(를) 참조하세요.
[원인]
◆ Visual Studio 2022 17.12 버전부터 .NET 7.0 빌드 불가능
[해결 방법]
1. .NET 버전 업그레이드
2. Visual Studio 버전 다운그레이드 (17.11 버전 이하)
3. global.json을 사용해 .NET SDK 버전을 지정하기
.NET을 지원되는 버전으로 업그레이드하는 방법이 좋습니다.
하지만 업그레이드를 할 수 없는 경우, global.json을 사용하여 빌드를 할 수 있습니다.
아래에서 세 번째 방법으로 오류를 해결해봅시다!
💡 해결 방법
1. Visual Studio에서 Ctrl + `로 개발자 PowerShell을 열어줍니다.
2. 'dotnet --list-sdks'를 입력해서 현재 설치된 SDK를 확인합니다.
3. 'dotnet new globaljson --sdk-version [SDK 버전 번호]'를 입력합니다.
4. 'dotnet workload restore'를 입력합니다.
- 이 부분에서 NuGet 패키지 관련 오류가 발생한다면 도구 > 옵션 > NuGet 패키지 관리자 > 패키지 소스에서
오류가 발생한 패키지 소스를 체크 해제 후 명령을 다시 입력하세요! (설치 완료되면 다시 체크하기)
5. 컴퓨터 재부팅을 합니다.
🔗 참고 링크
https://github.com/dotnet/maui/issues/25845
Unable to build and run an Android .NET 7 application with the latest MAUI .NET 9 / Visual Studio 17.12 installed · Issue #2584
Description I updated to Visual Studio 17.12 to get the latest .NET 9 and MAUI 9 features, etc. I still have one project that is sitting back on .NET 7, and it currently is unable to be updated to ...
github.com
https://github.com/dotnet/maui/issues/26020
Updating Visual Studio 2022 to 17.12.1 breaks all Maui builds · Issue #26020 · dotnet/maui
Description We have a 5 Maui projects, and since updating Visual Studio last night, all now fail to build, with a variety of new error messages: resource style/Maui.SplashTheme (aka XXXXXXX:style/M...
github.com
https://learn.microsoft.com/ko-kr/dotnet/core/tools/global-json
global.json 개요 - .NET CLI
.NET CLI 명령을 실행할 때 global.json 파일을 사용하여 .NET SDK 버전을 설정하는 방법을 알아봅니다.
learn.microsoft.com