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

Startup class in a library is not working #28722

Closed
iiibbbmmm opened this issue Dec 18, 2020 · 2 comments
Closed

Startup class in a library is not working #28722

iiibbbmmm opened this issue Dec 18, 2020 · 2 comments
Labels
area-hosting Includes Hosting area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions

Comments

@iiibbbmmm
Copy link

Describe the bug

Startup class in a library is not working

To Reproduce

  1. Create a new WebApplication with ASP.NET Core Web API presets (no HTTPS/Docker/OpenAPI).
  2. Create a new ClassLibrary(.NET Core) in the same solution.
  3. Reference ClassLibrary by WebApplication.
  4. Shift+Drag the Startup.cs from WebApplication to ClassLibrary.
  5. Put these in ClassLibrary.csproj.
  <ItemGroup>
    <FrameworkReference Include="Microsoft.AspNetCore.App" />
  </ItemGroup>
  1. Press F5.

Exceptions (if any)

HTTP ERROR 404

Further technical details

  • ASP.NET Core version
    5.0
  • Include the output of dotnet --info
info: Microsoft.Hosting.Lifetime[0]
      Now listening on: http://localhost:5000
info: Microsoft.Hosting.Lifetime[0]
      Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
      Hosting environment: Development
info: Microsoft.Hosting.Lifetime[0]
      Content root path: C:\dev\projects\aspnetcore-test\WebApplication1
  • The IDE (VS / VS Code/ VS4Mac) you're running on, and its version
    VS 2019 16.8.3
@mkArtakMSFT mkArtakMSFT added the feature-platform Deprecated: Cross-cutting issues related to ASP.NET Core as a platform label Dec 18, 2020
@Tratcher Tratcher added area-hosting and removed feature-platform Deprecated: Cross-cutting issues related to ASP.NET Core as a platform labels Dec 18, 2020
@Tratcher
Copy link
Member

Duplicate of #7315.

@shirhatti
Copy link
Contributor

Closing as dupe

@ghost ghost locked as resolved and limited conversation to collaborators Jan 17, 2021
@amcasey amcasey added the area-hosting Includes Hosting label Jun 1, 2023
@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Aug 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-hosting Includes Hosting area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
Projects
None yet
Development

No branches or pull requests

6 participants