【发布时间】:2016-02-14 18:41:05
【问题描述】:
我使用的是 Ubuntu 14.04
我已经使用这些说明安装了 ASP http://docs.asp.net/en/latest/getting-started/installing-on-linux.html#installing-on-ubuntu-14-04
运行dnvm list 给了我以下信息:
Active Version Runtime Architecture OperatingSystem Alias
------ ------- ------- ------------ --------------- -----
* 1.0.0-rc1-update1 coreclr x64 linux default
1.0.0-rc1-update1 mono linux/osx
然后我尝试使用本教程创建一个 ASP 应用程序: https://azure.microsoft.com/en-us/documentation/articles/web-sites-create-web-app-using-vscode/
但是,当我运行 dnx run 时,我收到以下错误:
System.InvalidOperationException: IHostingBuilder.UseServer() is required for Start()
at Microsoft.AspNet.Hosting.Internal.HostingEngine.EnsureServer()
at Microsoft.AspNet.Hosting.Internal.HostingEngine.BuildApplication()
at Microsoft.AspNet.Hosting.Internal.HostingEngine.Start()
at Microsoft.AspNet.Hosting.WebApplication.Run(Type startupType, String[] args)
at ASPTutorial.Startup.Main(String[] args)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.Dnx.Runtime.Common.EntryPointExecutor.Execute(Assembly assembly, String[] args, IServiceProvider serviceProvider)
at Microsoft.Dnx.ApplicationHost.Program.<>c__DisplayClass3_0.<ExecuteMain>b__0()
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
当我从 coreclr 更改为 mono 时,会出现类似的问题。
更新
dnx web 工作正常!
【问题讨论】:
-
dnx web怎么样? -
行得通!为什么
dnx run不起作用??? -
dnx run通常用于运行控制台应用程序。 -
dnx run用于控制台应用程序。顺便说一句:你可能想看看使用dotnetcli,因为dnx正在退休;-) github.com/dotnet/cli -
我很困惑为什么教程说要使用
dnx run。dotnetcli 也是微软官方维护的还是社区的东西?
标签: asp.net ubuntu mono dnx coreclr