In my case (NET Core 3.1) I fixed it by giving it an AssemblyName
tag in the ProjectGroup
section of the project file. e.g.
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<UseWPF>true</UseWPF>
<AssemblyName>ProjectNameUsually</AssemblyName>
</PropertyGroup>
...
</Project>
This also fixed a problem it was having with the compiler not seeing a control by its x:Name in the code-behind.