What happens if I add PackageReference net46 to the NET Core library?

I would like to create a library in NET Core that I can use in WPF apps as well as a future app in android. That's why I was thinking in the NET Core library.

However, if I add a link to this project in my WPF project, the link has a yellow triangle, I think because they are incompatible.

So, in the csproject file in my NET Core library, I add the following to the Group property:

<TargetFramework>net46</TargetFramework>

      

So now I can link in my WPF project with no problem. However, I am wondering how this affects the library. I mean, if I use the app in orroid or not, because as it refers to the NET Framework, maybe it now depends on the NET Core library, and as .NET Framework is not available on Android, I think that, maybe t use it.

So how does this affect?

Thank.

+3


source to share


1 answer


WPF projects and .NET Framework applications in general cannot reference .NET Core libraries. They are located in different parts of the Microsoft ecosystem.

However, both .NET Core projects and .NET Framework projects can use the .NET Standard libraries (Xamarin can also). You just need to target the .NET Standard edition supported by all of your platforms.



You can find a complete explanation of the .NET Standard and also see which platforms versions support it https://docs.microsoft.com/en-us/dotnet/articles/standard/library .

+3


source







All Articles