简体   繁体   English

.NET Core和.NET Framework交互

[英].NET Core and .NET Framework interaction

We have a project that references multiple NuGet libraries requiring the .NET Framework. 我们有一个项目引用了需要.NET Framework的多个NuGet库。 If we migrate to .NET Core, can we continue to use those NuGet libraries? 如果我们迁移到.NET Core,我们可以继续使用这些NuGet库吗?

If I want to pass a Type object from .NET Core to a NuGet package using the .NET Framework, will that work? 如果我想使用.NET Framework将Type对象从.NET Core传递到NuGet包,那会有用吗?

If you migrate to .NET Core, all dependencies you use will have to target .NET Core too. 如果迁移到.NET Core,则所使用的所有依赖项也必须以.NET Core为目标。

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将它们包含在代码中

#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. 但是,这意味着库提供的行为也是为.NET Core手动实现的。

No 没有

you will have to migrate your dependencies to dotnet core. 您必须将依赖项迁移到dotnet核心。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM