2

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?)

Bohdan
  • 1,987
  • 16
  • 23

1 Answers1

1

Nope. It is not possible to run an ASP.NET 5 application without DNX.

But you can run an ASP.NET 5 application without IIS. It can be self-hosted.

Victor Hurdugaci
  • 28,177
  • 5
  • 87
  • 103
  • It seems it can run without DNX on IIS: http://stackoverflow.com/questions/30939816/asp-net-v5-without-dnx – Bohdan Jun 28 '15 at 22:01
  • The answer provided is still using DNX. dnu publish --runtime bundled a local copy of the dnx with the application. So you don't need to seperately install a version of dnx (and possibly dnvm) on the server but you still have a dependency on dnx. Following the linked solution and before deploying delete dnx from the publish folder and it will not work. – Gerald Davis Jun 29 '15 at 14:54