3

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?

0

2 Answers 2

2

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.

Sign up to request clarification or add additional context in comments.

1 Comment

@mason OP is asking about references, not #IFDEF, in which .net or msbuild #IFDEF is supported for package references? both answers are valid.
1

No

you will have to migrate your dependencies to dotnet core.

1 Comment

It doesn't have to. That's why I said optionally. I simply assumed OPs dependencies are net451. I edited the answer now to remove it.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.