Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
224909b
Fix spurious rebuilds and projection generation churn in dev/IDE builds
manodasanW Jul 4, 2026
cd9dc76
Enable WUX authoring tests and fix WUX native-hosting projection gene…
manodasanW Jul 4, 2026
29bb315
Port AuthoringWinUITest to CsWinRT 3.0
manodasanW Jul 4, 2026
c219f18
Fix AuthoringWinUITest CS1069 by building AuthoringTest for native co…
manodasanW Jul 4, 2026
8dd9b30
Apply CsWinRT reference-projection ReferenceAssembly redirect on GetT…
manodasanW Jul 5, 2026
40592e9
Enable AuthoringWinUITest 3.0 packaging/runtime and re-enable WUX con…
manodasanW Jul 6, 2026
0cf002f
Remove AuthoringWinUITest packaging wapproj from cswinrt.slnx
manodasanW Jul 6, 2026
eed3d39
Keep AuthoringWinUITest wapproj in solution; fix NU1201 via AssetTarg…
manodasanW Jul 6, 2026
4f1dec9
Disable Release CI build for AuthoringWinUITest (RID winmd collision)…
manodasanW Jul 6, 2026
7162f96
Scope AuthoringWinUITest CI build exclusion to Release|x64 only (AOT …
manodasanW Jul 6, 2026
cd95c01
Trim AuthoringWinUITest Release|x64 exclusion comments in cswinrt.slnx
manodasanW Jul 6, 2026
8435cf3
Skip AuthoringWinUITest Release|x86 in solution build
manodasanW Jul 7, 2026
8f7e86f
Fix AuthoringWinUITest Release|x86 link by disabling LTCG
manodasanW Jul 7, 2026
97cd430
Skip AuthoringWinUITest Release|x86; LTCG fix was ineffective
manodasanW Jul 14, 2026
16cfdeb
Port ObjectLifetimeTests to CsWinRT 3.0 (C#/WinUI)
manodasanW Jul 15, 2026
f7d0c12
Track IObservableMap<K,V> Impl type in the interop generator
manodasanW Jul 15, 2026
a417169
Clarify BasicTest6b disabled-test comment
manodasanW Jul 15, 2026
bcc09e3
Enable Object Lifetime Tests in CI without failing on test failures
manodasanW Jul 15, 2026
99451bd
Enable ObjectLifetimeTests in the solution on the CsWinRT 3.0 TFM
manodasanW Jul 15, 2026
33203f9
Enable the Tests CI job
manodasanW Jul 15, 2026
4c473ef
Build full solution in Tests CI job so CsWinRT build tooling is avail…
manodasanW Jul 15, 2026
b231ce3
Tests CI job: build only the CsWinRT tooling, not the whole solution
manodasanW Jul 15, 2026
872e7e6
Tests CI job: also build WinRT.Internal in the tooling step
manodasanW Jul 15, 2026
461240c
Run native-consumer aggregation after Link to fix WinUI pre-link orde…
manodasanW Jul 18, 2026
6064426
Force full LTCG for Release C++ builds via ForceImportAfterCppTargets
manodasanW Jul 18, 2026
8d2d4be
Fix WinMD generator contract-assembly resolution for referenced proje…
manodasanW Jul 18, 2026
bfba440
Move IObservableMap<K,V> Impl tracking call next to its declaration
manodasanW Jul 19, 2026
22a8451
Trim verbose CI tooling-build comment in pipeline templates
manodasanW Jul 19, 2026
baafdf8
Always run ObjectLifetimeTests in-process
manodasanW Jul 19, 2026
0540829
Remove stale Source Generator Tests step; revert in-process test over…
manodasanW Jul 19, 2026
e52138f
Add in-process Object Lifetime test run to the pipeline
manodasanW Jul 19, 2026
e985c50
Capture in-process Object Lifetime test output
manodasanW Jul 19, 2026
a14321a
Disable VSTest ObjectLifetime run; trim in-process logging comments
manodasanW Jul 19, 2026
708f6d5
Re-enable VSTest ObjectLifetime run with diagnostics; warn-only in-pr…
manodasanW Jul 19, 2026
672994e
Publish Object Lifetime test artifacts and collect VSTest diagnostics
manodasanW Jul 19, 2026
3071fc2
Publish Object Lifetime in-process log and widen VSTest diag capture
manodasanW Jul 19, 2026
e0cf4ae
Capture VSTest discovery diag via /Diag instead of diagnosticsEnabled
manodasanW Jul 19, 2026
9187037
Disable VSTest ObjectLifetime run; root cause is CsWinRT 2.x MSTest a…
manodasanW Jul 19, 2026
4e6b0c3
Also run Object Lifetime tests in-process after Source Generator 2 tests
manodasanW Jul 19, 2026
84d7d94
Enable CsWinRT-Test-Steps.yml in the OneBranch Build/Test job
manodasanW Jul 20, 2026
152416b
Move Object Lifetime in-process run back to the Tests job; sync OneBr…
manodasanW Jul 20, 2026
b9409b5
Fix OneBranch Object Lifetime build: pass PublishBuildTool/BuildToolArch
manodasanW Jul 20, 2026
23d2dd5
Run Source Generator 2 tests on x64 only (fix x86 OOM)
manodasanW Jul 20, 2026
acf0e60
Verify WUX exception HR mapping by type full name in AuthoringWuxTest
manodasanW Jul 20, 2026
c2e47ee
Merge branch 'staging/3.0' into manodasanw/winuitest
manodasanW Jul 20, 2026
ebe73d7
Apply suggestions from code review
manodasanW Jul 21, 2026
7394fd0
Fix build
manodasanW Jul 21, 2026
8fd3c00
Merge branch 'staging/3.0' into manodasanw/winuitest
manodasanW Jul 21, 2026
284bf3b
Address PR review: move WindowsMetadataExpander to Core; non-nullable…
manodasanW Jul 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 71 additions & 11 deletions build/AzurePipelineTemplates/CsWinRT-BuildAndTest-Stage-GitHub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ stages:
# that can't run in the other environment.
- job: Tests
displayName: Run Tests
condition: false
condition: succeeded()
dependsOn: []
timeoutInMinutes: 120
strategy:
Expand All @@ -101,13 +101,26 @@ stages:
path: 's\src\TestWinRT'
displayName: "Checkout TestWinRT"

# Build Steps
# Build Steps
- template: CsWinRT-Build-Steps.yml@self
parameters:
BuildConfiguration: $(BuildConfiguration)
BuildPlatform: $(BuildPlatform)
SetupForBuildOnly: true

# Build just the CsWinRT build tooling (generator exes + WinRT.Generator.Tasks.dll)
# and WinRT.Internal (WindowsRuntime.Internal.winmd), which the standalone "Build
# Object Lifetime Tests" step below needs. Build by target name so the solution's
# BuildDependency ordering and x64->AnyCPU platform mapping apply.
- task: MSBuild@1
displayName: Build CsWinRT build tooling
condition: succeeded()
inputs:
solution: $(Build.SourcesDirectory)\src\cswinrt.slnx
msbuildArguments: /restore /t:WinRT_Generator_Tasks;WinRT_Impl_Generator;WinRT_Interop_Generator;WinRT_Projection_Generator;WinRT_Projection_Ref_Generator;WinRT_WinMD_Generator;WinRT_Internal /p:CIBuildReason=CI,VersionNumber=$(VersionNumber),VersionString=$(Build.BuildNumber),AssemblyVersionNumber=$(WinRT.Runtime.AssemblyVersion),PublishBuildTool=true,BuildToolArch=$(CsWinRTBuildToolsArch)
platform: $(BuildPlatform)
configuration: $(BuildConfiguration)

- task: MSBuild@1
displayName: Build Object Lifetime Tests
condition: succeeded()
Expand All @@ -117,20 +130,67 @@ stages:
platform: $(BuildPlatform)
configuration: $(BuildConfiguration)

# Run Object Lifetime Tests
# Run Object Lifetime Tests via VSTest. Currently DISABLED: VSTest discovery finds 0 tests because
# MSTest.TestAdapter.dll's module initializer (MSTestExecutor.SetPlatformLogger) references the CsWinRT
# 2.x type WinRT.ComWrappersSupport, which no longer exists in the CsWinRT 3.0 WinRT.Runtime (3.0.0.0)
# the app deploys. The adapter's <Module> initializer throws TypeLoadException, VSTest skips the whole
# adapter, and reports "No test is available". Root-caused from the vstest.console /Diag log. Kept (not
# removed) so it can be re-enabled once a CsWinRT 3.0-compatible MSTest adapter is available. Use the
# in-process runner below in the meantime.
- task: VSTest@3
displayName: Run Object Lifetime Tests
enabled: false
condition: succeeded()
continueOnError: true
inputs:
testAssemblyVer2: Tests\ObjectLifetimeTests\bin\$(BuildPlatform)\$(BuildConfiguration)\net10.0-windows10.0.19041.0\win-$(BuildPlatform)\ObjectLifetimeTests.Lifted.build.appxrecipe
testAssemblyVer2: Tests\ObjectLifetimeTests\bin\$(BuildPlatform)\$(BuildConfiguration)\net10.0-windows10.0.26100.1\win-$(BuildPlatform)\ObjectLifetimeTests.Lifted.build.appxrecipe
searchFolder: $(Build.SourcesDirectory)\src
resultsFolder: $(StagingFolder)\TestResults
otherConsoleOptions: /Diag:$(StagingFolder)\vstest-diag\log.txt

# Run Source Generator Tests
- task: DotNetCoreCLI@2
displayName: Run Source Generator Tests
# Run Object Lifetime Tests in-process by launching the packaged app directly (no --parentprocessid),
# which exercises App.OnLaunched's RunTestsInProcess path; the app self-exits with the pass/fail code.
# This is the actual test gate while VSTest discovery is broken (see above).
- task: PowerShell@2
displayName: Run Object Lifetime Tests (In-Process)
condition: succeeded()
# Some tests currently fail on CsWinRT 3.0; don't fail the pipeline on test failures for now.
continueOnError: true
inputs:
command: test
projects: 'src/Tests/SourceGeneratorTest/SourceGeneratorTest.csproj'
arguments: --diag $(StagingFolder)\unittest\test.log --logger trx;LogFilePath=UNITTEST-$(Build.BuildNumber).trx /nologo /m /p:configuration=$(BuildConfiguration);CIBuildReason=CI;solutiondir=$(Build.SourcesDirectory)\src\;VersionNumber=$(VersionNumber);VersionString=$(Build.BuildNumber);AssemblyVersionNumber=$(WinRT.Runtime.AssemblyVersion) -- RunConfiguration.TreatNoTestsAsError=true
testRunTitle: Unit Tests
targetType: filePath
filePath: $(Build.SourcesDirectory)\build\scripts\Run-ObjectLifetimeInProcess.ps1
arguments: -LayoutDir "$(Build.SourcesDirectory)\src\Tests\ObjectLifetimeTests\bin\$(BuildPlatform)\$(BuildConfiguration)\net10.0-windows10.0.26100.1\win-$(BuildPlatform)" -OutputDir "$(StagingFolder)\ObjectLifetime-InProc"

# Echo the vstest.console /Diag logs to the build log and publish them. DISABLED alongside the VSTest
# step above; re-enable together with it.
- task: PowerShell@2
displayName: Collect VSTest diagnostics
enabled: false
condition: succeededOrFailed()
continueOnError: true
inputs:
targetType: inline
script: |
$dest = Join-Path "$(StagingFolder)" 'vstest-diag'
New-Item -ItemType Directory -Force $dest | Out-Null
$patterns = 'log.*.txt','*.host.*.txt','*.datacollector.*.txt','*.diag'
$files = Get-ChildItem $dest -Recurse -File -Include $patterns -ErrorAction SilentlyContinue
if (-not $files) {
# Fallback: /Diag may have been ignored; scrape the default results/temp dirs.
$roots = @("$(Agent.TempDirectory)", "$(Common.TestResultsDirectory)") | Where-Object { $_ -and (Test-Path $_) } | Select-Object -Unique
$files = foreach ($r in $roots) { Get-ChildItem $r -Recurse -File -Include $patterns -ErrorAction SilentlyContinue }
$files | ForEach-Object { Copy-Item $_.FullName $dest -Force -ErrorAction SilentlyContinue }
}
if (-not $files) { Write-Host "No VSTest diagnostics found."; return }
foreach ($f in ($files | Sort-Object FullName -Unique)) {
Write-Host "===== $($f.Name) ====="
Get-Content $f.FullName -ErrorAction SilentlyContinue | ForEach-Object { Write-Host $_ }
}

templateContext:
outputs:
- output: pipelineArtifact
displayName: 'Publish Test artifacts'
condition: succeededOrFailed()
targetPath: $(StagingFolder)
artifactName: drop_Tests_$(BuildConfiguration)
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,7 @@ jobs:
BuildConfiguration: $(BuildConfiguration)
BuildPlatform: $(BuildPlatform)

# - template: CsWinRT-Test-Steps.yml@self
# parameters:
# BuildConfiguration: $(BuildConfiguration)
# BuildPlatform: $(BuildPlatform)
- template: CsWinRT-Test-Steps.yml@self

# Signing
- task: onebranch.pipeline.signing@1
Expand Down Expand Up @@ -126,7 +123,7 @@ jobs:
# that can't run in the other environment.
- job: Tests
displayName: Run Tests
condition: false
condition: succeeded()
dependsOn: []
pool:
type: windows
Expand Down Expand Up @@ -154,35 +151,87 @@ jobs:
displayName: "Checkout TestWinRT"

# Build Steps
# Build just the CsWinRT build tooling (generator exes + WinRT.Generator.Tasks.dll)
# and WinRT.Internal (WindowsRuntime.Internal.winmd), which the standalone "Build
# Object Lifetime Tests" step below needs. Build by target name so the solution's
# BuildDependency ordering and x64->AnyCPU platform mapping apply.
- template: CsWinRT-Build-Steps.yml@self
parameters:
BuildConfiguration: $(BuildConfiguration)
BuildPlatform: $(BuildPlatform)
SetupForBuildOnly: true

- task: MSBuild@1
displayName: Build CsWinRT build tooling
condition: succeeded()
inputs:
solution: $(Build.SourcesDirectory)\src\cswinrt.slnx
msbuildArguments: /restore /t:WinRT_Generator_Tasks;WinRT_Impl_Generator;WinRT_Interop_Generator;WinRT_Projection_Generator;WinRT_Projection_Ref_Generator;WinRT_WinMD_Generator;WinRT_Internal /p:CIBuildReason=CI,VersionNumber=$(VersionNumber),VersionString=$(Build.BuildNumber),AssemblyVersionNumber=$(WinRT.Runtime.AssemblyVersion),PublishBuildTool=true,BuildToolArch=$(CsWinRTBuildToolsArch)
platform: $(BuildPlatform)
configuration: $(BuildConfiguration)

- task: MSBuild@1
displayName: Build Object Lifetime Tests
condition: succeeded()
inputs:
solution: $(Build.SourcesDirectory)\src\Tests\ObjectLifetimeTests\ObjectLifetimeTests.Lifted.csproj
msbuildArguments: /restore /p:CIBuildReason=CI,solutiondir=$(Build.SourcesDirectory)\src\,VersionNumber=$(VersionNumber),VersionString=$(Build.BuildNumber),AssemblyVersionNumber=$(WinRT.Runtime.AssemblyVersion),GenerateTestProjection=true,AllowedReferenceRelatedFileExtensions=".xml;.pri;.dll.config;.exe.config"
msbuildArguments: /restore /p:CIBuildReason=CI,solutiondir=$(Build.SourcesDirectory)\src\,VersionNumber=$(VersionNumber),VersionString=$(Build.BuildNumber),AssemblyVersionNumber=$(WinRT.Runtime.AssemblyVersion),GenerateTestProjection=true,AllowedReferenceRelatedFileExtensions=".xml;.pri;.dll.config;.exe.config",PublishBuildTool=true,BuildToolArch=$(CsWinRTBuildToolsArch)
platform: $(BuildPlatform)
configuration: $(BuildConfiguration)

# Run Object Lifetime Tests
# Run Object Lifetime Tests via VSTest. Currently DISABLED: VSTest discovery finds 0 tests because
# MSTest.TestAdapter.dll's module initializer (MSTestExecutor.SetPlatformLogger) references the CsWinRT
# 2.x type WinRT.ComWrappersSupport, which no longer exists in the CsWinRT 3.0 WinRT.Runtime (3.0.0.0)
# the app deploys. The adapter's <Module> initializer throws TypeLoadException, VSTest skips the whole
# adapter, and reports "No test is available". Root-caused from the vstest.console /Diag log. Kept (not
# removed) so it can be re-enabled once a CsWinRT 3.0-compatible MSTest adapter is available. Use the
# in-process runner below in the meantime.
- task: VSTest@3
displayName: Run Object Lifetime Tests
enabled: false
condition: succeeded()
continueOnError: true
inputs:
testAssemblyVer2: Tests\ObjectLifetimeTests\bin\$(BuildPlatform)\$(BuildConfiguration)\net10.0-windows10.0.19041.0\win-$(BuildPlatform)\ObjectLifetimeTests.Lifted.build.appxrecipe
testAssemblyVer2: Tests\ObjectLifetimeTests\bin\$(BuildPlatform)\$(BuildConfiguration)\net10.0-windows10.0.26100.1\win-$(BuildPlatform)\ObjectLifetimeTests.Lifted.build.appxrecipe
searchFolder: $(Build.SourcesDirectory)\src
resultsFolder: $(StagingFolder)\TestResults
otherConsoleOptions: /Diag:$(StagingFolder)\vstest-diag\log.txt

# Run Source Generator Tests
- task: DotNetCoreCLI@2
displayName: Run Source Generator Tests
# Run Object Lifetime Tests in-process by launching the packaged app directly (no --parentprocessid),
# which exercises App.OnLaunched's RunTestsInProcess path; the app self-exits with the pass/fail code.
# This is the actual test gate while VSTest discovery is broken (see above).
- task: PowerShell@2
displayName: Run Object Lifetime Tests (In-Process)
condition: succeeded()
# Some tests currently fail on CsWinRT 3.0; don't fail the pipeline on test failures for now.
continueOnError: true
inputs:
targetType: filePath
filePath: $(Build.SourcesDirectory)\build\scripts\Run-ObjectLifetimeInProcess.ps1
arguments: -LayoutDir "$(Build.SourcesDirectory)\src\Tests\ObjectLifetimeTests\bin\$(BuildPlatform)\$(BuildConfiguration)\net10.0-windows10.0.26100.1\win-$(BuildPlatform)" -OutputDir "$(StagingFolder)\ObjectLifetime-InProc"

# Echo the vstest.console /Diag logs to the build log and publish them (via ob_outputDirectory auto-
# publish). DISABLED alongside the VSTest step above; re-enable together with it.
- task: PowerShell@2
displayName: Collect VSTest diagnostics
enabled: false
condition: succeededOrFailed()
continueOnError: true
inputs:
command: test
projects: 'src/Tests/SourceGeneratorTest/SourceGeneratorTest.csproj'
arguments: --diag $(StagingFolder)\unittest\test.log --logger trx;LogFilePath=UNITTEST-$(Build.BuildNumber).trx /nologo /m /p:configuration=$(BuildConfiguration);CIBuildReason=CI;solutiondir=$(Build.SourcesDirectory)\src\;VersionNumber=$(VersionNumber);VersionString=$(Build.BuildNumber);AssemblyVersionNumber=$(WinRT.Runtime.AssemblyVersion) -- RunConfiguration.TreatNoTestsAsError=true
testRunTitle: Unit Tests
targetType: inline
script: |
$dest = Join-Path "$(StagingFolder)" 'vstest-diag'
New-Item -ItemType Directory -Force $dest | Out-Null
$patterns = 'log.*.txt','*.host.*.txt','*.datacollector.*.txt','*.diag'
$files = Get-ChildItem $dest -Recurse -File -Include $patterns -ErrorAction SilentlyContinue
if (-not $files) {
# Fallback: /Diag may have been ignored; scrape the default results/temp dirs.
$roots = @("$(Agent.TempDirectory)", "$(Common.TestResultsDirectory)") | Where-Object { $_ -and (Test-Path $_) } | Select-Object -Unique
$files = foreach ($r in $roots) { Get-ChildItem $r -Recurse -File -Include $patterns -ErrorAction SilentlyContinue }
$files | ForEach-Object { Copy-Item $_.FullName $dest -Force -ErrorAction SilentlyContinue }
}
if (-not $files) { Write-Host "No VSTest diagnostics found."; return }
foreach ($f in ($files | Sort-Object FullName -Unique)) {
Write-Host "===== $($f.Name) ====="
Get-Content $f.FullName -ErrorAction SilentlyContinue | ForEach-Object { Write-Host $_ }
}
10 changes: 7 additions & 3 deletions build/AzurePipelineTemplates/CsWinRT-Test-Steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,14 @@ steps:
--no-build
testRunTitle: Unit Tests

# Run Source Generator 2 Tests
# Run Source Generator 2 Tests. Gated to x64 only: these are Roslyn analyzer/source-generator tests,
# which are architecture-independent (the compiler runs the analyzer the same regardless of the target
# platform), so running them x86 adds no coverage. The x86 (32-bit) test host loads the full .NET 10
# reference pack plus WinUI/CsWinRT references across 100+ cases and exhausts the ~2-4 GB address space
# on memory-constrained pools (e.g. the OneBranch managed pool), throwing OutOfMemoryException.
- task: DotNetCoreCLI@2
displayName: Run Source Generator 2 Tests
condition: and(succeeded(), or(eq(variables['BuildPlatform'], 'x86'), eq(variables['BuildPlatform'], 'x64')))
condition: and(succeeded(), eq(variables['BuildPlatform'], 'x64'))
inputs:
command: test
projects: 'src/Tests/SourceGenerator2Test/SourceGenerator2Test.csproj'
Expand Down Expand Up @@ -85,7 +89,7 @@ steps:
# Run WUX Tests
- task: CmdLine@2
displayName: Run WUX Tests
enabled: false
enabled: true
condition: and(succeeded(), or(eq(variables['BuildPlatform'], 'x86'), eq(variables['BuildPlatform'], 'x64')))
continueOnError: True
inputs:
Expand Down
2 changes: 1 addition & 1 deletion build/AzurePipelineTemplates/CsWinRT-Variables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ variables:
- name: NoSamples
value: 'false'
- name: _DotnetVersion
value: '10.0.106'
value: '10.0.109'

# This 'coalesce' pattern allows the yml to define a default value for a variable but allows the value to be overridden at queue time.
# E.g. '_IsRelease' defaults to empty string, but if 'IsRelease' is set at queue time that value will be used.
Expand Down
Loading