I created a simple MVC .Net Core application with two controllers (Home and Recipes). When I debug it in windows os I can navigate /Home and /Recipes But when I run in linux I can navigate only /Home but not /Recipes. It returns 404.
This is my Startup.cs Configure:
- using (var serviceScope = app.ApplicationServices.GetService<IServiceScopeFactory>().CreateScope())
- {
- var context = serviceScope.ServiceProvider.GetRequiredService<DbContext>();
- }
- if (env.IsDevelopment())
- {
- app.UseBrowserLink();
- app.UseDeveloperExceptionPage();
- }
- else
- {
- app.UseExceptionHandler("/Home/Error");
- }
- app.UseStaticFiles();
- app.UseMvc(routes =>
- {
- routes.MapRoute( name: "default", template: "{controller=Home}/{action=Index}/{id?}");
- });
I tried to call:
curl http://localhost:43124/Home/Index and It returns the html of the View curl http://localhost:43124/Recipes/Index and It returns nothing
What am I wrong?