@@ -170,13 +170,40 @@ jobs:
170170 - name : Build library
171171 run : npm run build
172172
173- - name : Setup MSBuild
173+ - name : Setup MSBuild with UWP support
174174 uses : microsoft/setup-msbuild@v2
175+ with :
176+ msbuild-architecture : x64
175177
176178 - name : Setup NuGet
177179 uses : nuget/setup-nuget@v2
178180 with :
179181 nuget-version : ' latest'
182+
183+ - name : Verify Windows 10 SDK
184+ run : |
185+ Write-Host "🔧 Checking Windows 10 SDK and UWP tools..."
186+ # Check Windows 10 SDK
187+ $sdkPath = "C:\Program Files (x86)\Windows Kits\10"
188+ if (Test-Path $sdkPath) {
189+ Write-Host "✅ Windows 10 SDK found"
190+ $versions = dir "$sdkPath\bin" -Directory -Name | Sort-Object -Descending
191+ Write-Host "Available SDK versions: $($versions -join ', ')"
192+ }
193+
194+ # Check MSBuild XAML targets
195+ $xamlTargets = "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\WindowsXaml"
196+ if (Test-Path $xamlTargets) {
197+ Write-Host "✅ XAML targets found at $xamlTargets"
198+ dir $xamlTargets -Recurse -Name "*.targets" | Select-Object -First 5
199+ } else {
200+ Write-Host "❌ XAML targets not found, checking alternative locations..."
201+ # Check other common locations
202+ $altPath = "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\WindowsXaml"
203+ if (Test-Path $altPath) {
204+ Write-Host "✅ Found XAML targets at $altPath"
205+ }
206+ }
180207
181208 - name : Verify react-native-windows installation
182209 run : |
@@ -217,8 +244,21 @@ jobs:
217244 working-directory : windows/RNViewShot
218245 run : |
219246 Write-Host "🔨 Building Windows C# project only..."
220- Write-Host "Restoring NuGet packages..."
221- dotnet restore RNViewShot.csproj
222- Write-Host "Building C# project..."
223- dotnet build RNViewShot.csproj --configuration Debug --no-restore
247+ Write-Host "Using MSBuild for UWP project..."
248+
249+ # Set explicit paths for MSBuild extensions
250+ $env:MSBuildExtensionsPath = "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild"
251+ $env:VisualStudioVersion = "17.0"
252+
253+ # Try to restore packages first
254+ nuget restore RNViewShot.csproj
255+
256+ # Build with explicit parameters
257+ msbuild RNViewShot.csproj `
258+ /p:Configuration=Debug `
259+ /p:Platform="AnyCPU" `
260+ /p:ReactNativeWindowsDir="../../node_modules/react-native-windows/" `
261+ /p:MSBuildExtensionsPath="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild" `
262+ /p:VisualStudioVersion="17.0" `
263+ /verbosity:normal
224264
0 commit comments