1. First, check if you have uploaded all necessary files of your API site to the server.
We recommend using Web Deploy
to publish your application, this will package your app to production files and upload them to the destination server.
2. Second, if the publish progress went smoothly, but you still receive error 404.
Please check the Startup.cs(.net core version lower than 6.0) or Program.cs(.net core version 6.0), make sure you have registered the Controller middleware properly and configured correct route for the API endpoint
public class Startup
public void ConfigureServices(IServiceCollection services)
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
// these settings can be customized
3. Thrid, all API endpoints work properly, but the Swagger docs(/swagger/index.html) link returns error 404, it works on your local but on server does not.
The OpenAPI support will be placed in development code snippets default, it only takes effect in the development environment, while the server default environment is production.
To make the Swagger docs work in a production server, you can move the above code snippets outside of the if judgment.
4. After you finish the above, please republish your API app to the server through Web Deploy and retry. If you still get an error when browsing the production site, you can enable the logging system of ASP.NET Core to diagnose.
5. Please feel free to contact our support if you need assistance.
Article ID: 2209, Created: February 17, 2022 at 9:24 PM, Modified: February 17, 2022 at 10:12 PM