I have a library written in .NET 6 and I need an application written in Wisej to reference it. But this is not possible because Wisej references .net 4.8. Is there a way around this problem?
Hi Julie!!
Thanks for your answer!
To illustrate, I attached to the example you sent me, a library, that I created, and referenced in the Wisej project. The Wisej project runtime takes place in the net4.8 environment and I don’t know how to get around it. See in the attached example that the application does not recognize the net6.0 runtime.
I know I’m doing something wrong but I don’t know what it is, since in the example the EntityFramework 6.0 packages were attached to the 6.0 runtime and it worked, but with my library it doesn’t work.
Thanks!
Yes, it’s possible and a normal thing to do in Visual Studio to have multi targeting.
There are 3 common approached to multi targeting whether it is for .NET versions or OS targets:
1. Conditional compilation #if NETCOREAPP
etc. You’ll find examples in most of Microsoft code on GitHub. You might also find the Microsoft Documentation on conditional compilation helpful.
2. Separating folders using conditional <ItemGroup>
in the sdk format project
3. Separating files using conditional <ItemGroup>
in the sdk format project
3a. Separating partial class files (most Microsoft projects use this approach with Socket.cs Socket.Windows.cs
and Socket.Unix.cs
for example, see Github)
See attached sample using EF Core.
We need net48 for the designer until Wisej.NET 4 where we will be able to have two separate designers, one for net48 and one for net core.
Please login first to submit.