Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove multiple startup #2538

Closed
wants to merge 1 commit into from
Closed

Conversation

Rick-Anderson
Copy link
Contributor

What's the purpose? I can't get this to work. See also #2511

What's the purpose? I can't get this to work. See also #2511
@Rick-Anderson
Copy link
Contributor Author

@Eilon please review. What's the intention here.

Main needs the correct NS to call Startup

public static void Main(string[] args)
        {
            var host = new WebHostBuilder()
                .UseKestrel()
                .UseContentRoot(Directory.GetCurrentDirectory())
                .UseIISIntegration()
                .UseStartup<Startup>()
                .Build();

            host.Run();
        }```

@ardalis
Copy link
Contributor

ardalis commented Jan 18, 2017

I believe this behavior only works (worked?) if you didn't specify .UseStartup() or .UseStartup<T>() in WebHostBuilder.

@Rick-Anderson
Copy link
Contributor Author

When I comment out /.UseStartup<Startup>(), I get
500 Internal Server Error No service for type 'Microsoft.AspNetCore.Hosting.IStartup' has been registered.

@ardalis
Copy link
Contributor

ardalis commented Jan 18, 2017

Ah, that must've changed since the betas, then.

@Eilon
Copy link
Member

Eilon commented Jan 20, 2017

@Tratcher can you comment on the behavior when there are multiple Startup classes, and which WebHostBuilder.UseStartupXYZ() method does what?

@Tratcher
Copy link
Member

A long time ago there was a feature to scan assemblies for Startup if you didn't specify UseStartup. This was removed when we added UseStartup<T>

Copy link
Member

@Tratcher Tratcher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This whole feature has been removed. Call UseStartup<T>

@Rick-Anderson
Copy link
Contributor Author

replaced by #2564

@Rick-Anderson Rick-Anderson deleted the Rick-Anderson-patch-1 branch January 21, 2017 01:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants