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 runs ASP.NET 5 applications.
My employer has many existing solutions targeting .NET Framework 4.5.2. In our existing Visual Studio solutions we might have the following projects:
[Solution] Sample.sln
    [Folder] src
        [Project] ClassLibrary.csproj
        [Project] WindowsService.csproj
        [Project] WebApplication.csproj
    [Folder] test
        [Project] ClassLibrary.UnitTests.csproj
        ...
In this scenario, ClassLibrary.csproj is a C# class library containing shared code. It is a dependency of / referenced by both WindowsService.csproj and WebApplication.csproj.
We aren't specifically trying to target .NET Core, dnxcore50. At this stage we are happy targeting .NET Framework, dnx451. However we are absolutely trying to leverage the new features of ASP.NET 5 and associated project structure.
Below are some options I've thought of but both have issues.
Option 1
When we replace the WebApplication.csproj project above with a new ASP.NET 5 DNX project WebApplication-dnx then we can still reference the ClassLibrary.csproj from both this new DNX project and the  existing WindowsService.csproj project. However some issues arise:
- This approach means any changes to code in - ClassLibrary.csprojneed a rebuild to be visible in the running- WebApplication-dnx. This isn't surprising but means we do not get full compile-from-source benefits for- WebApplication-dnx.
- We cannot easily target other frameworks, e.g. - dnxcore50. As above, this isn't specifically a goal at this stage.
Option 2
If we replace ClassLibrary.csproj with a DNX class library project^ ClassLibrary-dnx then the problems in option 1 do not apply. This approach would seem to be more in-keeping with the way the .NET runtime and associated technologies such as ASP.NET will be packaged moving forward.
However I cannot find a way to reference ClassLibrary-dnx from WindowsService.csproj. If this approach is viable I imagine the solution has something to do with the project level-option for Produce outputs on build and then referencing the .nupkg or perhaps even the .dll that is produced during the build. However, I cannot see a clean way of achieving this via the tooling.
^ DNX class library projects are called Class Library (Package) in VS 2015 RC. This project type was previously called ASP.NET Class Library in the CTPs.
Summary
Based on the information above I'm looking for:
- Some feedback to my scenario options and issues. 
- Suggestions for other options I have not thought of. 
- Perhaps an indication of which approach should be used moving forward. 
 
     
    