question

JeremyBradshaw-0935 avatar image
0 Votes"
JeremyBradshaw-0935 asked DaisyTian-1203 answered

VS2019 New Projects are limited to .Net Core

I'm trying to add a WPF User Control Library to my existing .NET Framework 4.7 Winforms solution to add a little WPF Interoperability. The new project is defaulted to the target framework ".NET Core 3.1" and the only other options are ".NET Core 3.0" and ".NET 5.0". All the other projects in this solution are set to ".NET Framework 4.7" so I think that's why I'm having some issues. Can't I create a new project targeted to ".NET Framework 4.7" even if I can't change a .NET Core project to it? It's the same even if I create a new winforms project.

windows-wpf
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I edited the .csproj file and manually changed the TargetFramework:

<TargetFramework>net47</TargetFramework>

Then unloaded and reloaded the project. So far that seems to have worked, but that can't be the recommended way surely?

0 Votes 0 ·

1 Answer

DaisyTian-1203 avatar image
0 Votes"
DaisyTian-1203 answered

You should choose WPF User Control Library (.NET Framework) to create WPF User Control Library project which target platform is .NET Framework. In Visual Studio 2019 , it looks like below picture shown:
80005-capture.png

If you choose WPF User Control Library (.NET) , the new project will target .NET Core platform. It is not recommended to covert .NET Core to .NET Framework, but the reverse conversion is possible, for more details about it, you can refer to the blog: Migrating a Sample WPF App to .NET Core 3 (Part 1)


If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


capture.png (27.0 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.