Asp.Net Core Web API not returning anything when publish alongside Angular app on IIS

I Published my Angular Application which has a ASP.Net Core API alongside to it. I published it using vs2019 publish to folder then copy the folders content to the IIS application folder. The Angular App gets served well but the api is returning the index. this is my endpoints configuration: app.UseEndpoints(endpoints => { endpoints.MapControllerRoute( name:…

Error 404 when calling POST method in asp.net mvc Core 2.1

I’m working on my first MVC Core 2.1 app and encountered problem (i guess with the routing). When calling a POST method shown below: [HttpPost] public RedirectToActionResult Remove(int id) { Product p = _repository.Products.Where(x => x.Id == id).FirstOrDefault(); _repository.Products.Remove(p); _repository.SaveChanges(); return RedirectToAction(“Index”); } i get the error 404 page not found. Below tag located in…

How to get the process name iisexpress instead of dotnet in asp.net core 2.2

I am learning asp.net core when executing in browser i am getting response header has kestrel instead of iisexpress. I wrote the following code in Startup.cs configure method to get the process name but i’m still getting dotnet i’m not able to get iisexpress. app.Run(async (context) => { await context.Response.WriteAsync(“Hello World!\n”); await context.Response.WriteAsync(System.Diagnostics.Process.GetCurrentProcess().ProcessName);//dotnet }); In…

Multiple controller route patterns with asp.net core 3 UseEndpoints

I’m converting an Asp.Net Core 2.2 Mvc application to 3.0; when I try to refactor the code to use UseEndpoints instead of UseMvc, the routes don’t appear to be recognized. The following is the working code from startup.cs using UseMvc public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseExceptionHandler(“/EventLog/Error”);…