Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.NET Core and .NET Framework interaction

Tags:

c#

.net

.net-core

We have a project that references multiple NuGet libraries requiring the .NET Framework. If we migrate to .NET Core, can we continue to use those NuGet libraries?

If I want to pass a Type object from .NET Core to a NuGet package using the .NET Framework, will that work?

like image 417
Yepeekai Avatar asked Jul 18 '26 22:07

Yepeekai


2 Answers

If you migrate to .NET Core, all dependencies you use will have to target .NET Core too.

It is possible to reference libraries only for one type of framework, for example

"frameworks": {
  "dnx451": {
    "dependencies": {
      "Akka": "1.0.6"
    }
  },
  "dnxcore50": {
  }
}

and use #if DNX451 to include them in the code only when targeting the full framework

#if DNX451
Console.WriteLine(typeof(Akka.Actor.ActorBase));
#endif

It means however that the behavior provided by the library has too be implemented manually for .NET Core.

like image 75
Jakub Lortz Avatar answered Jul 20 '26 13:07

Jakub Lortz


No

you will have to migrate your dependencies to dotnet core.

like image 20
Bilal Fazlani Avatar answered Jul 20 '26 11:07

Bilal Fazlani



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!