React.NET: InvalidOperationException at startup

When running my code, I get a System.InvalidOperationException at startup. How can I debug this?

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 1
  • Comments: 15 (7 by maintainers)

Commits related to this issue

Most upvoted comments

I think because https://github.com/reactjs/React.NET/blob/fe72ea9ca18793fea75282f0514e969384853d5e/src/React.Sample.CoreMvc/Startup.cs#L37 returns IServiceProvider, but! in default template it returns void. You can disable DI Scope validation and fix this problem, in program.cs

public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
            WebHost.CreateDefaultBuilder(args)
                .UseDefaultServiceProvider(options => options.ValidateScopes = false) // << add this line
                .UseStartup<Startup>();