powershell(7.1.3)에서 모듈을 게시하려고 하면 다음 오류가 발생합니다.
> Publish-Module -Name GreatDismal -NuGetApiKey [...]
Write-Error: C:\program files\powershell\7\Modules\PowerShellGet\PSModule.psm1:10990
Line |
10990 | … Publish-PSArtifactUtility @PublishPSArtifactUtility_Param …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Failed to generate the compressed file for module 'C:\Program Files\dotnet\dotnet.exe failed to pack: error Microsoft (R) Build Engine
| version 16.9.0+57a23d249 for .NET Copyright (C) Microsoft Corporation. All rights reserved. Determining projects to restore...
| C:\Program Files\dotnet\sdk\5.0.202\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.EolTargetFrameworks.targets(28,5): warning
| NETSDK1138: The target framework 'netcoreapp2.0' is out of support and will not receive security updates in the future. Please refer
| to https://aka.ms/dotnet-core-support for more information about the support policy.
| [C:\Users\sdixon\AppData\Local\Temp\49504ccb-87a6-43db-9133-46ffdc798eb9\Temp.csproj] C:\Program
| Files\dotnet\sdk\5.0.202\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.EolTargetFrameworks.targets(28,5): warning NETSDK1138: The
| target framework 'netcoreapp2.0' is out of support and will not receive security updates in the future. Please refer to
| https://aka.ms/dotnet-core-support for more information about the support policy.
| [C:\Users\sdixon\AppData\Local\Temp\49504ccb-87a6-43db-9133-46ffdc798eb9\Temp.csproj]
| C:\Users\sdixon\AppData\Local\Temp\49504ccb-87a6-43db-9133-46ffdc798eb9\Temp.csproj : error NU1100: Unable to resolve
| 'Microsoft.NETCore.App (>= 2.0.0)' for '.NETCoreApp,Version=v2.0'. Failed to restore
| C:\Users\sdixon\AppData\Local\Temp\49504ccb-87a6-43db-9133-46ffdc798eb9\Temp.csproj (in 94 ms). '.
dotnet-sdk 및 dotnetcore를 다시 설치/설치하려고 시도했지만 성공하지 못했으며 모두 끝났습니다. 어떤 아이디어가 있나요?
답변1
이것이 왜 작동했는지는 모르겠지만 문제가 해결된 것 같습니다.
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
Install-PackageProvider -Name PowerShellGet -Force -Scope CurrentUser
이 문제에 대한 버그 보고서에서 이 솔루션을 찾았습니다.https://github.com/PowerShell/PowerShellGetv2/issues/303