Yepeekai
Yepeekai

Reputation: 2723

.NET Core and .NET Framework interaction

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?

Upvotes: 3

Views: 649

Answers (2)

Bilal Fazlani
Bilal Fazlani

Reputation: 6967

No

you will have to migrate your dependencies to dotnet core.

Upvotes: 1

Jakub Lortz
Jakub Lortz

Reputation: 14896

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.

Upvotes: 2

Related Questions