Skip to content

Commit fccb4d0

Browse files
authored
Merge branch 'main' into fix_WrapLayoutSample
2 parents 723664d + 55b92b8 commit fccb4d0

File tree

4 files changed

+69
-53
lines changed

4 files changed

+69
-53
lines changed

.github/workflows/build.yml

Lines changed: 60 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ on:
1717
merge_group:
1818

1919
env:
20-
DOTNET_VERSION: ${{ '9.0.x' }}
20+
DOTNET_VERSION: '9.0.310' # Only used by jobs that cannot access global.json (no checkout/artifact-only jobs)
2121
ENABLE_DIAGNOSTICS: true
2222
MSBUILD_VERBOSITY: normal
2323
#COREHOST_TRACE: 1
@@ -36,17 +36,17 @@ jobs:
3636

3737
# Steps represent a sequence of tasks that will be executed as part of the job
3838
steps:
39-
- name: Install .NET SDK v${{ env.DOTNET_VERSION }}
40-
uses: actions/setup-dotnet@v4
41-
with:
42-
dotnet-version: ${{ env.DOTNET_VERSION }}
43-
4439
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
4540
- name: Checkout Repository
4641
uses: actions/checkout@v4
4742
with:
4843
submodules: recursive
4944

45+
- name: Install .NET SDK
46+
uses: actions/setup-dotnet@v4
47+
with:
48+
global-json-file: global.json
49+
5050
# Restore Tools from Manifest list in the Repository
5151
- name: Restore dotnet tools
5252
run: dotnet tool restore
@@ -59,6 +59,9 @@ jobs:
5959
needs: [Xaml-Style-Check]
6060
runs-on: windows-2022
6161

62+
env:
63+
PROCDUMP_PATH: ${{ github.workspace }}
64+
6265
# See https://docs.github.com/actions/using-jobs/using-a-matrix-for-your-jobs
6366
strategy:
6467
fail-fast: false # prevent one matrix pipeline from being cancelled if one fails, we want them all to run to completion.
@@ -82,29 +85,27 @@ jobs:
8285
maximum-size: 32GB
8386
disk-root: "C:"
8487

85-
- name: Enable User-Mode Dumps collecting
86-
if: ${{ env.ENABLE_DIAGNOSTICS == 'true' || env.COREHOST_TRACE != '' }}
87-
shell: powershell
88-
run: |
89-
New-Item '${{ github.workspace }}\CrashDumps' -Type Directory
90-
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps' -Name 'DumpFolder' -Type ExpandString -Value '${{ github.workspace }}\CrashDumps'
91-
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps' -Name 'DumpCount' -Type DWord -Value '10'
92-
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps' -Name 'DumpType' -Type DWord -Value '2'
88+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
89+
- name: Checkout Repository
90+
uses: actions/checkout@v4
91+
with:
92+
submodules: recursive
9393

94-
- name: Install .NET SDK v${{ env.DOTNET_VERSION }}
94+
- name: Install .NET SDK
9595
uses: actions/setup-dotnet@v4
9696
with:
97-
dotnet-version: ${{ env.DOTNET_VERSION }}
97+
global-json-file: global.json
9898

9999
- name: .NET Info (if diagnostics)
100100
if: ${{ env.ENABLE_DIAGNOSTICS == 'true' }}
101101
run: dotnet --info
102102

103-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
104-
- name: Checkout Repository
105-
uses: actions/checkout@v4
106-
with:
107-
submodules: recursive
103+
- name: Install procdump
104+
if: ${{ env.ENABLE_DIAGNOSTICS == 'true' }}
105+
shell: pwsh
106+
run: |
107+
Invoke-WebRequest -Uri https://download.sysinternals.com/files/Procdump.zip -OutFile Procdump.zip
108+
Expand-Archive -Path Procdump.zip -DestinationPath ${{ env.PROCDUMP_PATH }}
108109
109110
# Restore Tools from Manifest list in the Repository
110111
- name: Restore dotnet tools
@@ -157,10 +158,17 @@ jobs:
157158
id: test-generator
158159
run: vstest.console.exe ./tooling/CommunityToolkit.Tooling.SampleGen.Tests/bin/Release/net8.0/CommunityToolkit.Tooling.SampleGen.Tests.dll /logger:"trx;LogFileName=SourceGenerators.trx"
159160

161+
- name: Start Procdump monitoring for first-chance exceptions
162+
if: ${{ (matrix.multitarget == 'uwp' || matrix.multitarget == 'wasdk') && env.ENABLE_DIAGNOSTICS == 'true' }}
163+
shell: pwsh
164+
run: |
165+
$procdumpArgs = @("-accepteula", "-e", "1", "-w", "CommunityToolkit.Tests.${{ matrix.multitarget }}.exe", "-ma", "${{ env.PROCDUMP_PATH }}")
166+
Start-Process -FilePath "${{ env.PROCDUMP_PATH }}/procdump64.exe" -ArgumentList $procdumpArgs -NoNewWindow
167+
160168
- name: Run component tests against ${{ matrix.multitarget }}
161169
if: ${{ matrix.multitarget == 'uwp' || matrix.multitarget == 'wasdk' }}
162170
id: test-platform
163-
run: vstest.console.exe ./tooling/**/CommunityToolkit.Tests.${{ matrix.multitarget }}.build.appxrecipe /Framework:FrameworkUap10 /logger:"trx;LogFileName=${{ matrix.multitarget }}.trx" /Blame
171+
run: vstest.console.exe ./tooling/**/CommunityToolkit.Tests.${{ matrix.multitarget }}.build.appxrecipe /Framework:FrameworkUap10 /logger:"trx;LogFileName=${{ matrix.multitarget }}.trx" /Blame:"CollectDump;DumpType=Full;CollectHangDump;TestTimeout=30m;HangDumpType=Full" /Diag:"${{ github.workspace }}/vstest-diagnostic-log.txt"
164172

165173
- name: Create test reports
166174
run: |
@@ -178,7 +186,7 @@ jobs:
178186
uses: actions/upload-artifact@v4
179187
if: ${{ (env.ENABLE_DIAGNOSTICS == 'true' || env.COREHOST_TRACE != '') && always() }}
180188
with:
181-
name: ilc-repro
189+
name: ilc-repro-${{ matrix.multitarget }}-winui${{ matrix.winui }}
182190
path: ./*.zip
183191

184192
# https://github.com/dorny/paths-filter#custom-processing-of-changed-files
@@ -187,14 +195,21 @@ jobs:
187195
if: always()
188196
working-directory: ${{ github.workspace }}
189197
run: |
190-
echo "DUMP_FILE=$(Get-ChildItem .\CrashDumps\*.dmp -ErrorAction SilentlyContinue)" >> $env:GITHUB_OUTPUT
198+
echo "DUMP_FILE=$(Get-ChildItem ${{ env.PROCDUMP_PATH }}/**/*.dmp -ErrorAction SilentlyContinue)" >> $env:GITHUB_OUTPUT
191199
192-
- name: Artifact - WER crash dumps
200+
- name: Artifact - Process Dumps
193201
uses: actions/upload-artifact@v4
194202
if: ${{ (env.ENABLE_DIAGNOSTICS == 'true' || env.COREHOST_TRACE != '') && always() }}
195203
with:
196204
name: CrashDumps-${{ matrix.multitarget }}-winui${{ matrix.winui }}
197-
path: '${{ github.workspace }}/CrashDumps'
205+
path: ${{ env.PROCDUMP_PATH }}/**/*.dmp
206+
207+
- name: Artifact - vstest-diagnostic-log
208+
uses: actions/upload-artifact@v4
209+
if: always()
210+
with:
211+
name: 'vstest-diagnostic-log-${{ matrix.multitarget }}-winui${{ matrix.winui }}.txt'
212+
path: '${{ github.workspace }}/vstest-diagnostic-log.txt'
198213

199214
- name: Analyze Dump
200215
if: ${{ steps.detect-dump.outputs.DUMP_FILE != '' && (env.ENABLE_DIAGNOSTICS == 'true' || env.COREHOST_TRACE != '') && always() }}
@@ -214,21 +229,21 @@ jobs:
214229
VERSION_PROPERTY: ${{ github.ref == 'refs/heads/main' && format('build.{0}', github.run_number) || format('pull-{0}.{1}', github.event.number, github.run_number) }}
215230

216231
steps:
217-
- name: Install .NET SDK v${{ env.DOTNET_VERSION }}
232+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
233+
- name: Checkout Repository
234+
uses: actions/checkout@v4
235+
with:
236+
submodules: recursive
237+
238+
- name: Install .NET SDK
218239
uses: actions/setup-dotnet@v4
219240
with:
220-
dotnet-version: ${{ env.DOTNET_VERSION }}
241+
global-json-file: global.json
221242

222243
- name: .NET Info (if diagnostics)
223244
if: ${{ env.ENABLE_DIAGNOSTICS == 'true' }}
224245
run: dotnet --info
225246

226-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
227-
- name: Checkout Repository
228-
uses: actions/checkout@v4
229-
with:
230-
submodules: recursive
231-
232247
# Semver regex: https://regex101.com/r/Ly7O1x/3/
233248
- name: Format Date/Time of Release Package Version
234249
if: ${{ env.IS_RELEASE == 'true' }}
@@ -325,7 +340,7 @@ jobs:
325340
winui: [2, 3]
326341

327342
steps:
328-
- name: Install .NET SDK v${{ env.DOTNET_VERSION }}
343+
- name: Install .NET SDK
329344
uses: actions/setup-dotnet@v4
330345
with:
331346
dotnet-version: ${{ env.DOTNET_VERSION }}
@@ -390,7 +405,7 @@ jobs:
390405
winui: [2, 3]
391406

392407
steps:
393-
- name: Install .NET SDK v${{ env.DOTNET_VERSION }}
408+
- name: Install .NET SDK
394409
uses: actions/setup-dotnet@v4
395410
with:
396411
dotnet-version: ${{ env.DOTNET_VERSION }}
@@ -413,21 +428,21 @@ jobs:
413428
runs-on: ubuntu-latest
414429

415430
steps:
416-
- name: Install .NET SDK v${{ env.DOTNET_VERSION }}
431+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
432+
- name: Checkout Repository
433+
uses: actions/checkout@v4
434+
with:
435+
submodules: recursive
436+
437+
- name: Install .NET SDK
417438
uses: actions/setup-dotnet@v4
418439
with:
419-
dotnet-version: ${{ env.DOTNET_VERSION }}
440+
global-json-file: global.json
420441

421442
- name: .NET Info (if diagnostics)
422443
if: ${{ env.ENABLE_DIAGNOSTICS == 'true' }}
423444
run: dotnet --info
424445

425-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
426-
- name: Checkout Repository
427-
uses: actions/checkout@v4
428-
with:
429-
submodules: recursive
430-
431446
# Restore Tools from Manifest list in the Repository
432447
- name: Restore dotnet tools
433448
run: dotnet tool restore
@@ -459,3 +474,4 @@ jobs:
459474
with:
460475
name: linux-logs
461476
path: ./**/*.*log
477+

components/Extensions/src/Shadows/AttachedShadowBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@ protected internal virtual void OnElementContextInitialized(AttachedShadowElemen
161161
/// <param name="context">The <see cref="AttachedShadowElementContext"/> that is being uninitialized.</param>
162162
protected internal virtual void OnElementContextUninitialized(AttachedShadowElementContext context)
163163
{
164-
context.ClearAndDisposeResources();
165164
ElementCompositionPreview.SetElementChildVisual(context.Element, null!);
165+
context.ClearAndDisposeResources();
166166
}
167167

168168
/// <inheritdoc/>

components/Extensions/src/Shadows/AttachedShadowElementContext.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,12 @@ private void Uninitialize()
135135

136136
IsInitialized = false;
137137

138+
if (Element != null)
139+
{
140+
ElementCompositionPreview.SetElementChildVisual(Element, null!);
141+
Element.SizeChanged -= OnElementSizeChanged;
142+
}
143+
138144
Parent.OnElementContextUninitialized(this);
139145

140146
if (SpriteVisual != null)
@@ -148,12 +154,6 @@ private void Uninitialize()
148154
Shadow.Dispose();
149155
}
150156

151-
if (Element != null)
152-
{
153-
ElementCompositionPreview.SetElementChildVisual(Element, null!);
154-
Element.SizeChanged -= OnElementSizeChanged;
155-
}
156-
157157
SpriteVisual = null;
158158
Shadow = null;
159159
ElementVisual = null;

global.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"sdk": {
3-
"version": "9.0.101",
3+
"version": "9.0.310",
44
"rollForward": "latestFeature"
55
},
6-
"msbuild-sdks":
6+
"msbuild-sdks":
77
{
88
"MSBuild.Sdk.Extras":"3.0.23"
99
}

0 commit comments

Comments
 (0)