Most likely the default web site is using port 80 and your application is not deployed to the default web site. Therefore, a URL formatted as Controller/Action causes a 404 because it does not exist.
http://localhost:80/Test1Login/Login
I'm guessing you configured a sub application within the DefaultSite. The URL is similar to the following.
Do you know you can do this instead of using IIS Express, just connect the project to local IIS for testing and debugging?
The OP is having trouble deploying to local IIS.
DA924
Also, a 404 could mean that a DLL is missing too that was not in the deployment.
A missing DLL does not cause a 404. A missing DLL causes an unable to load error message.
About that 404, you have not experienced that the 404 can be about something else, like a DLL not found, becuase I got the 404 error that was suppressing the file not found exception for a DLL that was not there. All that was being tossed out was the 404
when I knew that it shouldn't have been tossing it out, which for me the 404 became a 'catch 22' that could mean that it could be more than it couldn't find a Web method based on signature.
I caught a glimpse of the exception before the 404 was tossed out while still in development and using local IIS.
The OP shouldn't have had to deploy to local IIS for debugging and testing the solution coming off of IIS Express, when the OP could have just had the VS Web project pushed to local IIS and not needed to do a deployment, if the OP's purpose was just to test
the project out on local IIS.
I use local IIS out the gate and seldom do I use IIS Express, in my personal usage.. I have never used IIS Express or the Web development server in VS prior to IIS Express not in any professional environment. It is always match the environment in development
one was eventually going to have the Web solution deployed to.
If you find the post has answered your issue, then please mark post as 'answered'.
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
Member
247 Points
474 Posts
404 page not found after deploying to my DEV box IIS
Jul 17, 2019 04:13 PM|gunderj|LINK
After deploying my web application to IIS on my DEV machine, I get 404 page not found with error below.
I created the website in IIS with defaultAppPool and physical path C:\Test1\webApp\Test1
It looks like MVC routing should work fine as it does work fine in my Visual Studio 2019.
Can someone advise how to resolve this? I have spent days trying many combinations and have proved that all files are where they should be. Thanks.
<div class="content-container">HTTP Error 404.0 - Not Found
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.
Detailed Error Information:
<div id="details-left">All-Star
58164 Points
15647 Posts
Re: 404 page not found after deploying to my DEV box IIS
Jul 17, 2019 05:06 PM|bruce (sqlwork.com)|LINK
it looks like your site is only using the static file handler. did you follow this instructions:
https://docs.microsoft.com/en-us/iis/application-frameworks/scenario-build-an-aspnet-website-on-iis/configure-an-asp-net-website-on-iis
Contributor
4923 Points
4198 Posts
Re: 404 page not found after deploying to my DEV box IIS
Jul 17, 2019 05:28 PM|DA924|LINK
Do you know you can do this instead of using IIS Express, just connect the project to local IIS for testing and debugging?
https://docs.microsoft.com/en-us/visualstudio/debugger/how-to-enable-debugging-for-aspnet-applications?view=vs-2017
Also, a 404 could mean that a DLL is missing too that was not in the deployment.
All-Star
53001 Points
23594 Posts
Re: 404 page not found after deploying to my DEV box IIS
Jul 17, 2019 06:29 PM|mgebhard|LINK
Most likely the default web site is using port 80 and your application is not deployed to the default web site. Therefore, a URL formatted as Controller/Action causes a 404 because it does not exist.
I'm guessing you configured a sub application within the DefaultSite. The URL is similar to the following.
All-Star
53001 Points
23594 Posts
Re: 404 page not found after deploying to my DEV box IIS
Jul 17, 2019 06:31 PM|mgebhard|LINK
The OP is having trouble deploying to local IIS.
A missing DLL does not cause a 404. A missing DLL causes an unable to load error message.
Contributor
4923 Points
4198 Posts
Re: 404 page not found after deploying to my DEV box IIS
Jul 17, 2019 09:15 PM|DA924|LINK
About that 404, you have not experienced that the 404 can be about something else, like a DLL not found, becuase I got the 404 error that was suppressing the file not found exception for a DLL that was not there. All that was being tossed out was the 404 when I knew that it shouldn't have been tossing it out, which for me the 404 became a 'catch 22' that could mean that it could be more than it couldn't find a Web method based on signature.
I caught a glimpse of the exception before the 404 was tossed out while still in development and using local IIS.
The OP shouldn't have had to deploy to local IIS for debugging and testing the solution coming off of IIS Express, when the OP could have just had the VS Web project pushed to local IIS and not needed to do a deployment, if the OP's purpose was just to test the project out on local IIS.
I use local IIS out the gate and seldom do I use IIS Express, in my personal usage.. I have never used IIS Express or the Web development server in VS prior to IIS Express not in any professional environment. It is always match the environment in development one was eventually going to have the Web solution deployed to.
Contributor
3710 Points
1431 Posts
Re: 404 page not found after deploying to my DEV box IIS
Jul 18, 2019 06:30 AM|Yuki Tao|LINK
Hi gunderj,
Keep in mind don't forget site name if you have set.
Error 404 on an MVC application indicates the IIS App is not configured correctly.
This assumes the all the necessary files have been moved. ie the bin folder exists.
Try to replace the absolute path with a relative path
Anyway, see the deployment docs for troubleshooting steps:
https://docs.microsoft.com/en-us/aspnet/web-forms/overview/deployment/visual-studio-web-deployment/deploying-to-iis
Best Regards.
Yuki Tao
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.