diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 2817fea9..3b3d280a 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -15,10 +15,10 @@ ] }, "microsoft.visualstudio.slngen.tool": { - "version": "11.2.3", + "version": "11.2.6", "commands": [ "slngen" ] } } -} \ No newline at end of file +} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e19ef14b..1128f304 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,7 +17,7 @@ on: env: DOTNET_VERSION: ${{ '8.0.x' }} - ENABLE_DIAGNOSTICS: false + ENABLE_DIAGNOSTICS: true #COREHOST_TRACE: 1 COREHOST_TRACEFILE: corehosttrace.log @@ -130,7 +130,7 @@ jobs: - name: Add project heads to ProjectTemplate working-directory: ./${{ env.PROJECT_DIRECTORY }} - run: ${{ github.workspace }}/${{ env.HEADS_DIRECTORY }}/GenerateSingleSampleHeads.ps1 -componentPath ${{ github.workspace }}/${{ env.PROJECT_DIRECTORY }}${{ env.ENABLE_DIAGNOSTICS == 'true' && ' -UseDiagnostics' || '' }} + run: ${{ github.workspace }}/${{ env.HEADS_DIRECTORY }}/GenerateSingleSampleHeads.ps1 -componentPath ${{ github.workspace }}/${{ env.PROJECT_DIRECTORY }} # Build and use template for creating new experiments - name: Build ProjectTemplate @@ -153,6 +153,50 @@ jobs: minimum-size: 32GB maximum-size: 32GB disk-root: "C:" + + - name: Enable Crash Dumps + if: ${{ env.ENABLE_DIAGNOSTICS == 'true' }} + shell: pwsh + run: | + # If we set the registry from a 32-bit process on a 64-bit machine, we will set the "virtualized" syswow registry. + # For crash dump collection we always want to set the "native" registry, so we make sure to invoke the native cmd.exe + $nativeCmdPath = "$env:SystemRoot\system32\cmd.exe" + if([Environment]::Is64BitOperatingSystem -and ![Environment]::Is64BitProcess) + { + # The "sysnative" path is a 'magic' path that allows a 32-bit process to invoke the native 64-bit cmd.exe. + $nativeCmdPath = "$env:SystemRoot\sysnative\cmd.exe" + } + + if(!$dumpFolder) + { + $dumpFolder = "C:\dumps" + } + + function Enable-CrashDumpsForProcesses { + Param([string[]]$namesOfProcessesForDumpCollection) + + foreach($procName in $namesOfProcessesForDumpCollection ) + { + Write-Host "Enabling local crash dumps for $procName" + & $nativeCmdPath /c reg add "HKLM\Software\Microsoft\Windows\Windows Error Reporting\LocalDumps\$procName" /v DumpFolder /t REG_EXPAND_SZ /d $dumpFolder /f + & $nativeCmdPath /c reg add "HKLM\Software\Microsoft\Windows\Windows Error Reporting\LocalDumps\$procName" /v DumpType /t REG_DWORD /d 2 /f + & $nativeCmdPath /c reg add "HKLM\Software\Microsoft\Windows\Windows Error Reporting\LocalDumps\$procName" /v DumpCount /t REG_DWORD /d 3 /f + } + } + + # enable dump collection for our test apps: + $namesOfProcessesForDumpCollection = @( + "CommunityToolkit.Tests.Uwp.exe", + "CommunityToolkit.Tests.WinAppSdk.exe", + "CiTestExp.Tests.Uwp.exe", + "CiTestExp.Tests.WinAppSdk.exe", + "Labs.CiTestExp.Tests.Uwp.exe", + "Labs.CiTestExp.Tests.AppSdk.exe", + "Labs.CiTestExp.Tests.Uwp_1.0.0.0_x64__1v6rh0sdhj24c.exe", + "Labs.CiTestExp.Tests.AppSdk_1.0.0.0_x64__1v6rh0sdhj24c.exe", + "VSTest.Console.exe") + + Enable-CrashDumpsForProcesses $namesOfProcessesForDumpCollection - name: Install .NET SDK v${{ env.DOTNET_VERSION }} uses: actions/setup-dotnet@v4 @@ -200,7 +244,7 @@ jobs: - name: Add project heads to ${{ env.TEST_PROJECT_NAME }} working-directory: ./${{ env.TEST_PROJECT_DIRECTORY }} - run: ${{ github.workspace }}/${{ env.HEADS_DIRECTORY }}/GenerateSingleSampleHeads.ps1 -componentPath ${{ github.workspace }}/${{ env.TEST_PROJECT_DIRECTORY }}${{ env.ENABLE_DIAGNOSTICS == 'true' && ' -UseDiagnostics' || '' }} + run: ${{ github.workspace }}/${{ env.HEADS_DIRECTORY }}/GenerateSingleSampleHeads.ps1 -componentPath ${{ github.workspace }}/${{ env.TEST_PROJECT_DIRECTORY }} - name: MSBuild working-directory: ./${{ env.TEST_PROJECT_DIRECTORY }} @@ -235,6 +279,13 @@ jobs: name: new-experiment-logs path: ./**/*.*log + - name: Artifact - Process Dumps + uses: actions/upload-artifact@v4 + if: ${{ (env.ENABLE_DIAGNOSTICS == 'true' || env.COREHOST_TRACE != '') && always() }} + with: + name: new-experiment-dumps + path: C:/dumps/*.*dmp + wasm-linux: runs-on: ubuntu-latest env: diff --git a/MultiTarget/PackageReferences/WinAppSdk.props b/MultiTarget/PackageReferences/WinAppSdk.props index 20463cae..1e598248 100644 --- a/MultiTarget/PackageReferences/WinAppSdk.props +++ b/MultiTarget/PackageReferences/WinAppSdk.props @@ -1,6 +1,9 @@ - + + + + diff --git a/MultiTarget/WinUI.Extra.props b/MultiTarget/WinUI.Extra.props index ba824ca0..d27db269 100644 --- a/MultiTarget/WinUI.Extra.props +++ b/MultiTarget/WinUI.Extra.props @@ -26,7 +26,7 @@ win-x86;win-x64;win-arm64 win10-x86;win10-x64;win10-arm64 - win-x86;win-x64;win-arm64 + 10.0.22621.37-preview diff --git a/ProjectHeads/Head.WinAppSdk.props b/ProjectHeads/Head.WinAppSdk.props index 74b8498a..56c090c9 100644 --- a/ProjectHeads/Head.WinAppSdk.props +++ b/ProjectHeads/Head.WinAppSdk.props @@ -15,8 +15,9 @@ - - false + true + win-$(Platform) + win10-$(Platform)