question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Remove the importance of app configuration order

See original GitHub issue

The problem

I was reading the docs on upgrading a 2.1 app to 3.1 which used endpoint routing and could not figure out why my routes were not being picked up. It turned out that app.UseEndpoints(...) needed to be placed before app.UseSpa(...).

There were many warnings in the migration docs about the configuration order eg:

If the app calls UseStaticFiles, place UseStaticFiles before UseRouting.

For most apps, calls to UseAuthentication, UseAuthorization, and UseCors must appear between the calls to UseRouting and UseEndpoints to be effective.

There were no warnings about endpoints and spa. I had to generate a new SPA template to look at the order to finally figure out what the issue was.

Describe the solution you’d like

It would be great if the order of app.UseX was not so critical to a functioning application. All of the gotchas and warnings would be unnecessary. I know there are technical reasons for pipeline registration but I would think that something could sit in the middle and build the configuration in the proper order.

Since I’m sure you’ve already discussed this and decided to push this onto the developers, I think some documentation around the endpoints and spa needs to be specifically added. Maybe some sort of ordered master list info graphic of when to register what could help.

I was getting tripped up because the spa static files were being returned instead of the api route even though my use endpoints and use routing configuration were after the use static files and use spa static files.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
Rick-Andersoncommented, Feb 4, 2020
0reactions
Rick-Andersoncommented, Feb 4, 2020
Read more comments on GitHub >

github_iconTop Results From Across the Web

App configuration policies for Microsoft Intune
App configuration policies can help you eliminate app setup problems by letting you assign configuration settings to a policy that is assigned ...
Read more >
azurerm_app_configuration | Resources | hashicorp/azurerm
Recovering a soft-deleted App Configuration requires the Microsoft.AppConfiguration/configurationStores/write permission on Subscription or Resource Group scope ...
Read more >
Global App Config Settings policy
Administrators can create a global policies with different app settings (silent install, auto-update ... Remove app when device is quarantined or signed out....
Read more >
Manage mobile apps for your organization
Edit or delete a managed configuration · Sign in to your Google Admin console. · In the Admin console, go to Menu ·...
Read more >
Add Assignments and Exclusions to your Applications
From the ellipses-vertical, you can click copy if you choose to duplicate the assignment configurations. Delete, From the ellipses-vertical, you ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found