ASP.NET Core Web Api 2.1's default files work, but controllers return 404 when deployed on IIS 8.5
up vote
0
down vote
favorite
So, I have an Angular 7 application deployed to an instance of IIS 8.5. To serve the actual Angular application, I serve it using the UseDefaultFiles()
method on Startup.cs
.
app.UseDefaultFiles();
app.UseStaticFiles();
app.UseAuthentication();
app.UseHttpsRedirection();
app.UseMvc();
Fair enough. The actual index.html
and related .js files in wwwroot
are served with no complications, and my app works. Then, my Angular app tries to make a request to my Web API, and well...
Failed to load resource: the server responded with a status of 404 (Not Found)
Under what circumstances would this even happen? It works fine on my machine.
asp.net-core asp.net-core-webapi angular7
add a comment |
up vote
0
down vote
favorite
So, I have an Angular 7 application deployed to an instance of IIS 8.5. To serve the actual Angular application, I serve it using the UseDefaultFiles()
method on Startup.cs
.
app.UseDefaultFiles();
app.UseStaticFiles();
app.UseAuthentication();
app.UseHttpsRedirection();
app.UseMvc();
Fair enough. The actual index.html
and related .js files in wwwroot
are served with no complications, and my app works. Then, my Angular app tries to make a request to my Web API, and well...
Failed to load resource: the server responded with a status of 404 (Not Found)
Under what circumstances would this even happen? It works fine on my machine.
asp.net-core asp.net-core-webapi angular7
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
So, I have an Angular 7 application deployed to an instance of IIS 8.5. To serve the actual Angular application, I serve it using the UseDefaultFiles()
method on Startup.cs
.
app.UseDefaultFiles();
app.UseStaticFiles();
app.UseAuthentication();
app.UseHttpsRedirection();
app.UseMvc();
Fair enough. The actual index.html
and related .js files in wwwroot
are served with no complications, and my app works. Then, my Angular app tries to make a request to my Web API, and well...
Failed to load resource: the server responded with a status of 404 (Not Found)
Under what circumstances would this even happen? It works fine on my machine.
asp.net-core asp.net-core-webapi angular7
So, I have an Angular 7 application deployed to an instance of IIS 8.5. To serve the actual Angular application, I serve it using the UseDefaultFiles()
method on Startup.cs
.
app.UseDefaultFiles();
app.UseStaticFiles();
app.UseAuthentication();
app.UseHttpsRedirection();
app.UseMvc();
Fair enough. The actual index.html
and related .js files in wwwroot
are served with no complications, and my app works. Then, my Angular app tries to make a request to my Web API, and well...
Failed to load resource: the server responded with a status of 404 (Not Found)
Under what circumstances would this even happen? It works fine on my machine.
asp.net-core asp.net-core-webapi angular7
asp.net-core asp.net-core-webapi angular7
edited 2 hours ago


Goncalo Peres
8611311
8611311
asked Oct 30 at 21:01
F.O. Senn
134
134
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53072862%2fasp-net-core-web-api-2-1s-default-files-work-but-controllers-return-404-when-d%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown