简体   繁体   English

您可以从常规c#类库中引用.NET Core类库吗?

[英]Can you reference a .NET Core class library from a regular c# Class Library?

I have two class libraries. 我有两个类库。 One is a C# Class Library (from Visual Studio 2015 -> New Project -> Installed -> Templates -> Visual C# -> Class Library) . 一个是C#类库 (来自Visual Studio 2015->新建项目->已安装->模板-> Visual C#->类库) The other is C# Class Library (.NET Core) (from Visual Studio 2015 -> New Project -> Installed -> Templates -> Visual C# -> Class Library (.NET Core)) . 另一个是C#类库(.NET Core) (来自Visual Studio 2015->新建项目->已安装->模板-> Visual C#->类库(.NET Core))

I added a reference from my C# Class Library to my .NET Core Class Library, but it's not finding the namepsace when I try to do using CoreClassLibraryNamespace; 我将C#类库中的引用添加到.NET Core类库中,但是当我尝试using CoreClassLibraryNamespace;

Is it possible to reference a .NET Core library from a regular C# Class Library? 是否可以从常规C#类库引用.NET Core库?

You can't reference a pure .NET Core library from a classic .NET project as of today. 到目前为止,您无法从经典.NET项目中引用纯.NET Core库。 You can, however, create a Portable Class Library (template "Class Library (Portable)", aka PCL) with targets ".NET Framework 4.x" and "ASP.NET Core 1.0". 但是,您可以创建目标为“ .NET Framework 4.x”和“ ASP.NET Core 1.0”的可移植类库(模板“类库(可移植),也称为PCL”)。 The resulting library can be referenced from Core and classic projects. 可以从Core和classic项目中引用生成的库。

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

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