From 0e752d76e2016a7255b338473efd1065253ffa05 Mon Sep 17 00:00:00 2001 From: Yun Chan Date: Wed, 6 May 2026 23:20:45 +0900 Subject: [PATCH] =?UTF-8?q?ci:=20vcxproj=EB=A5=BC=20packages.config=20?= =?UTF-8?q?=ED=98=95=EC=8B=9D=EC=9C=BC=EB=A1=9C=20=EB=B3=B5=EA=B7=80,=20Bu?= =?UTF-8?q?ildMsix=EA=B0=80=20nuget.exe=20=EC=9E=90=EB=8F=99=20=EC=B2=98?= =?UTF-8?q?=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 증상: VS 2022 Enterprise(GitHub windows-latest)에서 PackageReference 형식 vcxproj 빌드 시 ResolveNuGetPackageAssets가 "Sequence contains no elements" 오류로 실패. native vcxproj + PackageReference + msbuild restore 조합의 알려진 회귀. 해결: - src/EverythingToJpeg.Shell/EverythingToJpeg.Shell.vcxproj: PackageReference 제거, packages.config + Microsoft.Windows.ImplementationLibrary.targets imports 복귀, EnsureNuGetPackageBuildImports target 복귀. - src/EverythingToJpeg.Shell/packages.config 재추가. - packaging/BuildMsix.ps1: nuget.exe 없으면 dist.nuget.org에서 자동 다운로드, packages.config 기반 restore를 packages/ 폴더에 수행. - .gitignore: packages/, tools/ 제외. 이러면 사용자 PC(VS 2026)와 CI(VS 2022) 모두 동일한 흐름으로 빌드. Co-Authored-By: Claude Opus 4.7 (1M context) --- .gitignore | 4 ++++ packaging/BuildMsix.ps1 | 21 +++++++++++++++++-- .../EverythingToJpeg.Shell.vcxproj | 18 ++++++++++++---- src/EverythingToJpeg.Shell/packages.config | 4 ++++ 4 files changed, 41 insertions(+), 6 deletions(-) create mode 100644 src/EverythingToJpeg.Shell/packages.config diff --git a/.gitignore b/.gitignore index a02eac6..5221139 100644 --- a/.gitignore +++ b/.gitignore @@ -46,3 +46,7 @@ src/EverythingToJpeg.Shell/Everythi*/ # .NET artifacts dir from BuildMsix.ps1 artifacts/ + +# NuGet packages restore + nuget.exe cache +packages/ +tools/ diff --git a/packaging/BuildMsix.ps1 b/packaging/BuildMsix.ps1 index 86087dd..14dd699 100644 --- a/packaging/BuildMsix.ps1 +++ b/packaging/BuildMsix.ps1 @@ -75,8 +75,25 @@ if ($LASTEXITCODE -ne 0) { throw 'dotnet publish 실패' } # ---- 2) C++ Shell DLL ---- Write-Host '' Write-Host '[2/5] C++ Shell DLL 빌드' -& $msbuild $shellProj /t:Restore /p:RestorePackagesConfig=true /p:Configuration=$Configuration /p:Platform=$Platform /v:minimal | Out-Host -if ($LASTEXITCODE -ne 0) { throw 'Shell restore 실패' } + +# nuget.exe 자동 다운로드 (없으면) +$nuget = Get-Command nuget.exe -ErrorAction SilentlyContinue +if (-not $nuget) { + $nugetExe = Join-Path $repoRoot 'tools\nuget.exe' + if (-not (Test-Path $nugetExe)) { + New-Item -ItemType Directory -Path (Split-Path $nugetExe) -Force | Out-Null + Write-Host ' nuget.exe 다운로드 중…' + Invoke-WebRequest -Uri 'https://dist.nuget.org/win-x86-commandline/latest/nuget.exe' -OutFile $nugetExe + } + $nugetCmd = $nugetExe +} else { + $nugetCmd = $nuget.Source +} + +$packagesDir = Join-Path $repoRoot 'packages' +& $nugetCmd restore (Join-Path $repoRoot 'src\EverythingToJpeg.Shell\packages.config') -PackagesDirectory $packagesDir | Out-Host +if ($LASTEXITCODE -ne 0) { throw 'NuGet restore 실패' } + & $msbuild $shellProj /p:Configuration=$Configuration /p:Platform=$Platform /m /v:minimal | Out-Host if ($LASTEXITCODE -ne 0) { throw 'Shell build 실패' } $shellDll = Join-Path $repoRoot ("src\EverythingToJpeg.Shell\$Platform\$Configuration\EverythingToJpeg.Shell.dll") diff --git a/src/EverythingToJpeg.Shell/EverythingToJpeg.Shell.vcxproj b/src/EverythingToJpeg.Shell/EverythingToJpeg.Shell.vcxproj index f8ec53e..a2fa155 100644 --- a/src/EverythingToJpeg.Shell/EverythingToJpeg.Shell.vcxproj +++ b/src/EverythingToJpeg.Shell/EverythingToJpeg.Shell.vcxproj @@ -99,12 +99,22 @@ + - - - - + + + + + + + + WIL NuGet 패키지가 복원되지 않았습니다. nuget restore를 먼저 실행하세요. + + + diff --git a/src/EverythingToJpeg.Shell/packages.config b/src/EverythingToJpeg.Shell/packages.config new file mode 100644 index 0000000..33d04fe --- /dev/null +++ b/src/EverythingToJpeg.Shell/packages.config @@ -0,0 +1,4 @@ + + + +