自托管在.NET 4.5应用ASP.NET 5(不含DNX和IIS) [英] Self-hosting ASP.NET 5 within .NET 4.5 Application (without DNX and IIS)

查看:488
本文介绍了自托管在.NET 4.5应用ASP.NET 5(不含DNX和IIS)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能增加一个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.

这篇关于自托管在.NET 4.5应用ASP.NET 5(不含DNX和IIS)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆