We have a class library, ToolsOfOurTeam, that needs to work for several solutions; most (legacy solutions) use .Net framework 4.8, a more recent one uses .Net 5.0. Thanks to another question, I've been able to use
<PropertyGroup>
<TargetFrameworks>net5.0-windows;net48</TargetFrameworks>
<Platforms>AnyCPU;x86;x64</Platforms>
<UseWPF>true</UseWPF>
</PropertyGroup>
to include a class that uses CommandManager to implement ICommand.
Now I need to use ToolsOfOurTeam on a test project in one of the legacy solutions. The test project uses .Net 5.0 too, but just .Net 5.0, not the Windows variant.
Which means, of course, that referencing the ToolsOfOurTeam for .Net framework 4.8 in the test project raises a warning.
And referencing ToolsOfOurTeam for .Net 5.0 Windows raises an error.
So I'd like to add net.50 to the target frameworks, but simply adding it to the <TargetWrameworks> node raises another error, NETSDK1136: The target framework must be Windows because the <UseWPF> node implies that the whole thing runs on Windows.
I don't feel it makes sense to have our test project be tied to Windows. What can I do?