Is it possible to add an ASP.NET 5 Web Application as a reference to a traditional .NET 4.5 project (Windows Service or Console App) and start it in-process?
Ideally within one solution, so that ASP.NET application and host service can share references to other projects in the same solution.
Tried so far:
dnu publish
produces packages, but attempting to add them produces following error: Install-Package : Could not install package 'WebApplication1 1.0.0'. You are trying to install this package into a project that targets '.NETFramework, Version=v4.5', but the package does not contain any assembly references or content files that are compatible with that framework. When changing framework dnx451
to net451
, Web Application doesn't compile because of missing ASP references.
dnu build
produces binaries, but how to run the application? (where to get IApplicationBuilder and IHostingEnvironment instances?)