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?

前端 未结 1 379
轻奢々
轻奢々 2020-12-24 00:48

Scenario

I\'m experimenting with Visual Studio 2015 RC, specifically looking at switching to the new ASP.NET 5 framework, project structure and the new DNX that ru

相关标签:
1条回答
  • 2020-12-24 01:35

    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.

    0 讨论(0)
提交回复
热议问题