'Microsoft.AspNet.Server.Kestrel'不包含适用于入口点的静态'Main'方法 [英] 'Microsoft.AspNet.Server.Kestrel' does not contain a static 'Main' method suitable for an entry point
问题描述
我正在尝试运行最新的 Asp.Net 5示例(当前为1.0.0-rc1-update1)(位于Windows 10上的powershell中).我已将活动DNX和默认DNX设置为CLR x86.我对这3个项目中的每一个都运行了 dnu restore
命令,该操作已成功完成,没有错误.
I'm trying to run the latest Asp.Net 5 samples (currently 1.0.0-rc1-update1) from powershell on Windows 10. I have the active and default DNX set as the CLR x86. I have run the dnu restore
command against each of the 3 projects and this has completed without error.
如果我为控制台示例运行命令 dnx run
,则可以正常运行.但是,当我随后从任何一个Web项目的文件夹中运行命令 dnx web
时,我会收到错误消息;
If I run the command dnx run
for the console sample this works fine. However, when I then run the command dnx web
from within either of the web project's folders I get the error message;
'Microsoft.AspNet.Server.Kestrel'不包含适用于入口点的静态'Main'方法
这些示例非常基础,因此我认为它必须是我的dnx配置的一部分.但是为什么会发生这种情况,我该如何解决呢?
The samples are pretty basic and so I assume it must be part of my dnx configuration. But why is this happening and how do I fix it?
推荐答案
问题的原因实际上是一个奇怪的原因,但看起来 dnu restore
命令区分大小写.我认为这也与必须在Linux上运行有关,但是我不确定.
The cause of the issue is a strange one actually but it looks like the dnu restore
command is case-sensitive. I assume this has something to do with it having to run on Linux too but I'm not sure.
在powershell中,我当前的路径全是小写字母,但我的文件夹结构却不是.在 webhello
中,如果我运行命令 cd .. \ WebHello
然后运行 dnu restore
,则恢复工作正常,并且dnx web
命令也可以正常运行.
In powershell my current path was all lowercase but my folder structure wasn't. Whilst in webhello
, if I ran the command cd ..\WebHello
and then ran dnu restore
, the restore worked fine and the dnx web
command also then ran fine.
有趣的是,如果我运行 cd .. \ webhello
,则 dnx web
命令仍然可以正常工作.
Interestingly, if I ran cd ..\webhello
, the dnx web
command still works fine.
这篇关于'Microsoft.AspNet.Server.Kestrel'不包含适用于入口点的静态'Main'方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!