是否有可能增加一个ASP.NET 5 Web应用程序作为参考,传统的.NET 4.5的项目(Windows服务或控制台应用程序),并在进程启动?
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?
理想情况下在一个溶液,使ASP.NET应用程序和主机服务可以在同一溶液中共享引用其他项目。
Ideally within one solution, so that ASP.NET application and host service can share references to other projects in the same solution.
到目前为止已经试过:
DNU发布
产包,但尝试添加它们会产生以下错误:安装-套餐:无法安装包'WebApplication1 1.0.0。您正在尝试安装此包到该目标的.NETFramework,版本= V4.5的一个项目,但包不包含与该框架兼容的任何程序集引用或内容文件。的当改变框架 dnx451
到 net451
,Web应用程序不会由于缺少ASP引用编译。
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构建
生成的二进制文件,但如何运行应用程序? (从哪里得到的 IApplicationBuilder 和 IHostingEnvironment 的实例吗?)
dnu build
produces binaries, but how to run the application? (where to get IApplicationBuilder and IHostingEnvironment instances?)
都能跟得上。这是不可能的运行ASP.NET 5应用程序,而不DNX
Nope. It is not possible to run an ASP.NET 5 application without DNX.
但是你可以运行ASP.NET 5应用程序没有IIS。它可以是自托管
But you can run an ASP.NET 5 application without IIS. It can be self-hosted.