aspnetcore: Fail to run sample: No service for type 'Microsoft.Framework.Runtime.IApplication...."

Hello, I am getting an error when I try to run the sample projects with the dnx dev branch. Can anyone see if I am doing something wrong?

Host: Windows 7 64-bit SP1 with .NET 4.5 and PS 4

C:\Users\Admin>@powershell -NoProfile -ExecutionPolicy unrestricted -Command “&{$Branch=‘dev’;iex ((new-object net.webclient).DownloadString(‘https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.ps1’))}”

Using temporary directory: C:\Users\Admin\AppData\Local\Temp\dnvminstall
Downloading DNVM.ps1 to
Downloading DNVM.cmd to
Installing DNVM
Installing .NET Version Manager to C:\Users\Admin\.dnx\bin
Creating destination folder 'C:\Users\Admin\.dnx\bin' ...
Installing 'dnvm.ps1' to 'C:\Users\Admin\.dnx\bin' ...
Installing 'dnvm.cmd' to 'C:\Users\Admin\.dnx\bin' ...
Adding C:\Users\Admin\.dnx\bin to Process PATH
Adding C:\Users\Admin\.dnx\bin to User PATH
Adding C:\Users\Admin\.dnx to Process DNX_HOME
Adding C:\Users\Admin\.dnx to User DNX_HOME

C:\Users\Admin>dnvm upgrade

Determining latest version
Downloading dnx-clr-win-x86.1.0.0-beta4 from https://www.nuget.org/api/v2
Installing to C:\Users\Admin\.dnx\runtimes\dnx-clr-win-x86.1.0.0-beta4
Adding C:\Users\Admin\.dnx\runtimes\dnx-clr-win-x86.1.0.0-beta4\bin to process PATH
Adding C:\Users\Admin\.dnx\runtimes\dnx-clr-win-x86.1.0.0-beta4\bin to user PATH
Native image generation (ngen) is skipped. Include -Ngen switch to turn on native image generation to improve application startup time.
Setting alias 'default' to 'dnx-clr-win-x86.1.0.0-beta4'

c:>dnvm upgrade -u

Determining latest version
Downloading dnx-clr-win-x86.1.0.0-beta5-11682 from https://www.myget.org/F/aspnetvnext/api/v2
Installing to C:\Users\Admin\.dnx\runtimes\dnx-clr-win-x86.1.0.0-beta5-11682
Adding C:\Users\Admin\.dnx\runtimes\dnx-clr-win-x86.1.0.0-beta5-11682\bin to process PATH
Adding C:\Users\Admin\.dnx\runtimes\dnx-clr-win-x86.1.0.0-beta5-11682\bin to user PATH
Native image generation (ngen) is skipped. Include -Ngen switch to turn on native image generation to improve application startup time.
Updating alias 'default' to 'dnx-clr-win-x86.1.0.0-beta5-11682'

c:>mkdir test2 c:>cd test2 c:\test2>git clone http://github.com/aspnet/home

  • Clones correctly (no errors)*

c:\test2>dnu restore

  • Restores correctly (no errors)*

c:\test2\home\samples\latest\HelloMvc>dnx . web

System.InvalidOperationException: No service for type 'Microsoft.Framework.Runtime.IApplicationEnvironment' has been registered.
   at Microsoft.Framework.DependencyInjection.ServiceProviderExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
   at Microsoft.Framework.DependencyInjection.ServiceProviderExtensions.GetRequiredService[T](IServiceProvider provider)
   at Microsoft.AspNet.Hosting.HostingEngine..ctor(IServiceProvider fallbackServices)
   at Microsoft.AspNet.Hosting.Program.Main(String[] args)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.Framework.Runtime.Common.EntryPointExecutor.Execute(Assembly assembly, String[] args, IServiceProvider serviceProvider)
   at Microsoft.Framework.ApplicationHost.Program.ExecuteMain(DefaultHost host, String applicationName, String[] args)
   at Microsoft.Framework.ApplicationHost.Program.Main(String[] args)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.Framework.Runtime.Common.EntryPointExecutor.Execute(Assembly assembly, String[] args, IServiceProvider serviceProvider)
   at dnx.host.Bootstrapper.RunAsync(List`1 args)
   at dnx.host.RuntimeBootstrapper.ExecuteAsync(String[] args)
   at dnx.host.RuntimeBootstrapper.Execute(String[] args)

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 56 (18 by maintainers)

Most upvoted comments

Same issues on a Mac Book, I followed the instructions for getting started and the samples will not run. I’ll try this again in 6 months when you guys have something worth spending time on.