【发布时间】:2015-12-01 19:52:07
【问题描述】:
我正在尝试创建一个类库,其中将包含 WebAPI(使用 ASP.NET 5)和消费 UWP 应用程序的常见对象(主要是 DTO)。但是,我还没有弄清楚如何创建可以从其他两个项目中引用的类库。
到目前为止我所做的尝试:
首先,我尝试了一个类库(包),可以在Web下找到。这种类型的库可以毫无问题地从 ASP.NET 项目中引用,但是在尝试从 UWP 项目中引用它时,我收到以下消息:
A reference to 'ClassLibrary1' could not be added.
接下来,我尝试了一个类库(Windows Universal),它可以在Windows > Universal下找到。这可以很容易地从 UWP 项目中引用,但是当尝试从 ASP.NET 中引用它时,我得到:
The following projects are not supported as references :
- The project ClassLibrary2 has a target framework that is incompatible or has version higher than the current project and cannot be referenced.
那么:如何创建一个可用于 ASP.NET 5 项目和 UWP 项目的类库?
【问题讨论】:
标签: asp.net-core uwp project.json