What are my options for sharing code between DNX / ASP.NET 5 projects (project.json / xproj) and other C# projects (csproj) within a single solution?

你离开我真会死。 提交于 2019-11-29 22:07:08
Victor Hurdugaci

Take a look at what EntityFramework does.

They target 3 TFMs: net45, .NETPortable,Version=v4.5,Profile=Profile7, frameworkAssemblies and they have both csproj and xproj in the same folder.

Basically, for each project you have two project files.

However I cannot find a way to reference ClassLibrary-dnx from WindowsService.csproj.

Unfortunately, that's not possible, yet. You can only reference csproj from xproj, not the other way around. You have two alternatives: (1) have both xproj and csproj like EF does or (2) reference the NuGet package from csproj.

If you want to do alternative (2) then you can set the output of the xproj to a folder and add that as a NuGet feed.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!