简体   繁体   English

ASP.NET Core 1.0 - 对.NET 4.5项目的API引用

[英]ASP.NET Core 1.0 - API reference to a .NET 4.5 project

I'm running a solution with project built using .NET 4.5 and now in that same solution I'm adding a ASP Core 1.0 API project that will need to add some of the other projects as reference. 我正在运行一个使用.NET 4.5构建项目的解决方案,现在在同一个解决方案中,我正在添加一个ASP Core 1.0 API项目,需要添加一些其他项目作为参考。

At the moment, I've tried the "Add reference" functionality and wrapping the referenced project on the "project.json" file and the result is still the same. 目前,我已经尝试了“添加引用”功能并将引用的项目包装在“project.json”文件中,结果仍然相同。 On the github page I've looked on the issues to see if there's something similar but nothing so far. 在github页面上我查看了问题,看看是否有类似但迄今为止没有任何内容。

Is it possible to do this? 是否有可能做到这一点? In a solution with 10 .NET 4.5 other projects (class libraries), add a MVC 6 API project and use the old 4.5 projects as reference in the new on? 在一个包含10个.NET 4.5其他项目(类库)的解决方案中,添加一个MVC 6 API项目并使用旧的4.5项目作为新参考?

Using command line from inside the folder of the .net core api solution: 使用.net核心api解决方案文件夹内的命令行:

dnu wrap full_path_to_an_assembly[**\**.dll] -f framework_version [net45]

Inside Visual Studio, "Add Reference" -> select your .NET 4.5 Project and it works. 在Visual Studio中,“添加引用” - >选择您的.NET 4.5项目并且它可以工作。

No need to add wrappedprojects section to project.json. 无需将wrappedprojects部分添加到project.json。

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

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