CommunityToolkit / CommunityToolkit/Windows
Primitives tests failing in Visual Studio but not in CI
- Dominant language
- C#
- Stars
- 1.1k
- Forks
- 166
- PR merge metrics
- No merged PRs in 30d
Description
### Describe the bug
This was found while investigating [Fix: DockPanel measure fix #618](https://github.com/CommunityToolkit/Windows/pull/618)
The tests in Primitives are failing when run in Visual Studio, but not when run in CI.
```
Message:
Test method PrimitivesTests.Test_WrapPanel_BasicLayout.Test_WrapPanel_Normal_Horizontal threw exception:
Microsoft.UI.Xaml.Markup.XamlParseException: The text associated with this error code could not be found.
The type 'WrapPanel' was not found. [Line: 5 Position: 25]
Stack Trace:
ExceptionHelpers.g__Throw|38_0(Int32 hr)
ExceptionHelpers.ThrowExceptionForHR(Int32 hr)
IXamlReaderStaticsMethods.Load(IObjectReference _obj, String xaml)
XamlReader.Load(String xaml)
Test_WrapPanel_BasicLayout.b__0_0()
<b__1>d.MoveNext()
--- End of stack trace from previous location ---
Test_WrapPanel_BasicLayout.Test_WrapPanel_Normal_Horizontal()
ThreadOperations.ExecuteWithAbortSafety(Action action)
```
### Steps to reproduce
```text
1. Open Primitives in the single-component solution using `./tooling/GenerateSingleSolution.ps1 -c Primitives`
2. Run the unit tests in Visual Studio and observe the failure
```
### Expected behavior
Tests that were passing in the past should pass now.
### Screenshots

### Code Platform
- [ ] UWP
- [ ] WinAppSDK / WinUI 3
- [ ] Web Assembly (WASM)
- [ ] Android
- [ ] iOS
- [ ] MacOS
- [ ] Linux / GTK
### Windows Build Number
- [ ] Windows 10 1809 (Build 17763)
- [ ] Windows 10 1903 (Build 18362)
- [ ] Windows 10 1909 (Build 18363)
- [ ] Windows 10 2004 (Build 19041)
- [ ] Windows 10 20H2 (Build 19042)
- [ ] Windows 10 21H1 (Build 19043)
- [ ] Windows 10 21H2 (Build 19044)
- [ ] Windows 10 22H2 (Build 19045)
- [ ] Windows 11 21H2 (Build 22000)
- [ ] Other (specify)
### Other Windows Build number
_No response_
### App minimum and target SDK version
- [ ] Windows 10, version 1809 (Build 17763)
- [ ] Windows 10, version 1903 (Build 18362)
- [ ] Windows 10, version 1909 (Build 18363)
- [ ] Windows 10, version 2004 (Build 19041)
- [ ] Windows 10, version 2104 (Build 20348)
- [ ] Windows 11, version 22H2 (Build 22000)
- [ ] Other (specify)
### Other SDK version
_No response_
### Visual Studio Version
_No response_
### Visual Studio Build Number
_No response_
### Device form factor
_No response_
### Additional context
_No response_
### Help us help you
Yes, I'd like to be assigned to work on this item.
Contributor guide
Assessment
This issue has not been assessed yet.