You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 1, 2024. It is now read-only.
When unit testing AsyncCommand and AsyncValueCommand using .NET Core on a non-windows operating system, System.TypeLoadException is thrown:
System.TypeLoadException : Could not load type 'System.Windows.Threading.Dispatcher' from assembly 'WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
TypeLoadException is thrown for a combination of the following reasons:
BaseCommand.wpf.cs uses System.Windows.Threading.Dispatcher which is only available on Windows
.NET Core dependencies for the NuGet package assume the user is running WPF on Windows (see image)
On macOS, in Visual Studio for Mac, open AsyncCommandSample.sln
In Visual Studio for Mac, run all Unit Tests
In Visual Studio for Mac, confirm the test failed
Expected Behavior
Unit Test should pass
(The Unit Test does pass when the test is on a Windows machine)
Actual Behavior
System.TypeLoadException is thrown:
System.TypeLoadException : Could not load type 'System.Windows.Threading.Dispatcher' from assembly 'WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.