看起来每晚RC2版本的最新更新改变了程序启动的方式.自更新以来,我现在在运行以下命令时出现错误.
// "commands": {
// "web": "Microsoft.AspNet.Server.Kestrel --server.urls http://localhost:1287"
// }
dnx --watch web
'Microsoft.AspNet.Server.Kestrel' does not contain a 'Program' type suitable for an entry point Stopped listening.
Run Code Online (Sandbox Code Playgroud)
Startup.cs编译并具有以下方法.
public class Startup
{
public void ConfigureServices(IServiceCollection services, IHostingEnvironment env)
{ ... }
public void Configure(IApplicationBuilder app, IApplicationLifetime lifetime)
{ ... }
}
Run Code Online (Sandbox Code Playgroud)
需要做些什么才能让程序启动最新的每晚构建?
这是一个重现问题的例子.https://github.com/roydukkey/moist/tree/stackoverflow-34615917
sdk:v1.0.0-rc2-16357
在aspnet/Hosting#521中,多个入口点已被删除。
\n\n\n\n\n以前,我们有多个 Web 应用程序入口点,包括托管 (
\nMicrosoft.AspNet.Hosting)、服务器(例如Microsoft.AspNet.Server.Kestrel)和应用程序本身(例如Startup.cs)。我们已经删除了托管和服务器中的入口点,因此前进的唯一入口点来自应用程序。project.json这将需要将以下设置更新emitEntryPoint为 truecompilationOptions并设置commands为指向启动程序集。aspnet/公告#131
要解决此问题,commands设置需要指向程序集,而不是列出以前有效的服务器配置。此外,emitEntryPoint需要启用该设置。这两个设置都是从project.json .
"compilationOptions": {\n "emitEntryPoint": true\n },\n\n "commands": {\n- "web": "Microsoft.AspNet.Server.Kestrel"\n+ "web": "Web"\n }\nRun Code Online (Sandbox Code Playgroud)\n\n具体的服务器配置现在位于hosting.json. 以下只是一个示例配置。
\xef\xbb\xbf{\n "server": "Microsoft.AspNet.Server.Kestrel",\n "server.urls": "http://localhost:1234"\n}\nRun Code Online (Sandbox Code Playgroud)\n\n请参阅roydukkey/moist/tree/stackoverflow-34615917以查看整个问题的工作流程。
\n| 归档时间: |
|
| 查看次数: |
2414 次 |
| 最近记录: |