Reputation: 11763
I read: .NET Dispatcher, for .NET Core?
I'm not able to apply both solution.
Any idea how to access the Dispatcher from .net-core 3.1?
IMPORTANT Clemens solution works great. Also, by reloading the project directly from Visual Studio has the advantage to tell you more about the problem hidden in your .csproj file. I had unmatching UseWPF with UseWpf!
Upvotes: 2
Views: 2174
Reputation: 11
Since a visual studio update has broke my project file my side i decide post how this should be done in 2022.
just check this checkbox in project properties.
then visual studio should rewrite your project file and add the framework wpf to your reference automaticaly.
Upvotes: 0
Reputation: 128181
The project file should look like this:
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<UseWPF>true</UseWPF>
</PropertyGroup>
</Project>
If the project is unloaded, use Reload Project
from the content menu.
Upvotes: 5