Failed to load resource : 404 error when changing ASP.NET MVC server from IIS Express to Local IIS - asp.net-mvc

I wanted to host my ASP.NET MVC app in a LAN network. So I changed the server to Local IIS and that's when the 404 error appeared. Only the home page is loading ok, but all actions in controller that I have defined in my app are not found and the 404 error is being thrown.
Maybe I got it wrong when configuring IIS or my app. Please help!
I have already tried the but i didn't help.

check .net version for this apppool at iss and version of your target framework in your project.

I faced a similar issue while playing a video uploaded through the same application.
It was playing on my local machine while but when I published the project I was giving
Failed to load resource 404 error.
It was MIME Types error the video/mp4 was not added in IIS MIME Types.
follow these steps to add MIME Type in IIS

Related

Server Manager opens up whenever i try to open "Turn Windows features on or off"

I'm working on ASP.NET Core MVC 2.1 application and i have AWS server to deploy it to. In my remote desktop i have placed by code in wwwroot directory in inetpub. Whenever i try to browse my application it gives me 500 Internal Server Error.
HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.
I looked for the solution and found that problem lies in IIS according to this URL HERE
But when i click Turn Windows features on or off in the windows menu or through control, it always open Server Manager. Can somebody tell me why this happens or how to apply the changes mentioned in the url i have specified above.
Thanks

How I do for my project using Local IIS

I'm using Visual Studio 2013, Windows 8.1 and IIS 8.0.
In properties settings, I have set the server to Local IIS and I set the project url to localhost/myProject.
When I debug the project I get the following error shown below:
Unable to start debugging on the web server. The web server could not find the requested resource.
Click Help for more information.
OK Help
and when I start without debugging I get this error:
Error HTTP 403.14 - Forbidden
can somenone help me?
You need to give proper permissions to the directory containing your application. Give read, write, and modify permissions to IUSR and IIS_USERS. This should help to resolve your issue. Did your application work using IIS Express? If it didn't work using IIS Express then I'll need more specific information on the issue you're running into.

ASP.NET 4.5.1 MVC 5 application not loading in browser. Failed to open http://

Problem
I am using windows authentication with MVC5 ASP.NET application. When I went to the url of the application on my intranet, I typed in (just for example), http://derp.herp.edu. As expected, it
asked me for my login credentials on the domain. I entered these.
I then get a completely blank page. No error message. Just a white screen. I then fired up the debugger in my browser and it simply states:
Failed to open http://derp.herp.edu
Details
I don't even know where to find an error for this? I have no clue to what is causing this. I've been trying to look for logs, but since I am new to IIS7.5 I am not sure I am looking at the right ones.
I just deployed the MVC5 on an IIS7.5 Windows 2008 R2 server. It is my belief that the IIS I am trying to deploy this on is on a secured VLAN.
Attempts
Launched locally on my machine IIS7.5. It works. What the heck?
Moved to wwwroot of the inetpub file to make sure file permissions are okay on server.
Associated the default web site on IIS7.5 to the domain name. I can see it on my local machine and the server in the browser.
Thus, we know the domain name works. We know that authentication is trying to work. But something is going wrong when it tries to display the MVC 5 .NET application.
I figured out the error. It was a completely silent error as the browser was just sitting there not doing anything. I started checking IIS and noticed that .NET compilation had some problems. I found the fix at ASPNET4BreakingChangesAndStuffToBeAwareOf.

How to precompile MVC for intranet?

VS2013 Update3, .Net 4.5, MVC, IIS 7
I created a new mvc project.
Tested from VS and it works.
From IIs, I created a folder in wwwroot, and made it an application. Add app pool with .net 4.0. Enabled windows authentication and disabled Anonymous authentication. Set service account in app pool and webapp.
From VS I deploy to IIS with default settings (which is NOT precompile) (using File System)
Site works fine on IIS.
But…
If deploy with the precompile setting clicked on. Web site fails with 403 error. Tried various combinations and get never get the precompiled to work. Always works when non-precompiled.
ASP.NET 4 was is registered in IIS.
Tried modules runAllManagedModulesForAllRequests="true" with no success.
I'm out of ideas and looking for help
Server Error in Application "xxx/MVCHELLOWORLD"
Internet Information Services 7.5
Error Summary
HTTP Error 403.14 - Forbidden
The Web server is configured to not list the contents of this directory.
Detailed Error Information
Module
DirectoryListingModule
Notification
ExecuteRequestHandler
Handler
StaticFile
Error Code
0x00000000
Requested URL
http://xxx/MvcHelloWorld/
Physical Path
C:\inetpub\wwwroot\MvcHelloWorld\
Logon Method
Negotiate
Most likely causes: •A default document is not configured for the requested URL, and directory browsing is not enabled on the server.
Things you can try: •If you do not want to enable directory browsing, ensure that a default document is configured and that the file exists.
• Enable directory browsing using IIS Manager. 1.Open IIS Manager.
2.In the Features view, double-click Directory Browsing.
3.On the Directory Browsing page, in the Actions pane, click Enable.
•Verify that the configuration/system.webServer/directoryBrowse#enabled attribute is set to true in the site or application configuration file.
Links and More InformationThis error occurs when a document is not specified in the URL, no default document is specified for the Web site or application, and directory listing is not enabled for the Web site or application. This setting may be disabled on purpose to secure the contents of the server.
View more information »
I just had the same issue and have been trying to resolve it for the last couple of days.
I have a Windows 8 pc running IIS 8 Express.
I copied an MVC site that was compiled and published from another pc, ran it, and got the same 403.14 forbidden as above. I then tried publishing the site uncompiled and running it and the site loaded just fine.
I then decided to load Visual Web Express on the Windows 8 pc and created a dummy MVC site and ran it compiled and uncompiled and it worked just fine. This showed me that IIS 8 Express was configured and working properly and there must be some issue in the way the site was compiling.
I tried different precompile methods during the publish including do not merge, merge all and merge each folder but none of those many any difference.
In the end I solved this by changing the Copy Local property to true for every Assembly referenced within the project. Even all the default ones that should be referenced from the GAC.
Not sure if I needed to copy every assembly to the bin folder or not but given the large number of assemblies referenced within my project this seemed easier then trying them 1 by 1.
EDIT: Made some changes and republished the site and now I'm back to the 403.14 forbidden again :(
I'm really pulling my hair out on this one as to why it isn't working.

Publish ASP.NET MVC Application : read configuration file permissions

I am having some trouble when publishing an MVC application to a server, and even to my personal computer.
The server has the MVC framework installed so that is not the problem, and I also have it installed obviously.
The problem on my local machine is obviously a permissions thing but im not sure what permissions are needed... I tried adding IUSR to the application itself.
The iis error message is:
Module IIS Web Core
Notification BeginRequest
Handler Not yet determined
Error Code 0x80070005
Config Error Cannot read configuration file due to insufficient permissions
Config File ~\Visual Studio 2008\Project\MVCApp\web.config
and on the server im getting "The page cannot be found" when trying to view anything in the app.
also this is a forms auth app that denys everything but authenticated users
You need to have wildcard mappings turned on so that it can resolve the routes.
Take a look at option 1:
http://blog.codeville.net/2008/07/04/options-for-deploying-aspnet-mvc-to-iis-6/
Basically, IIS is trying to locate a file at the given URL, but it doesn't exist because they are MVC Routes. You need to tell IIS to hand off the request to the ASP.Net route handler, and not to worry about checking if the file exists on the file system. (it will never exist)
I found out that upgrading an MVC 2 project to MVC 3 resulted in the sam error as described above:
Module IIS Web Core Notification BeginRequest Handler Not yet determined Error Code 0x80070005 Config Error Cannot read configuration file due to insufficient permissions Config File ~\Visual Studio 2010\Project\MVCApp\web.config
What solved the problem for me was to delete the Virtual Directory for the project in my localhost IIS, and then clean and rebuild the project.
NOTE! This was an MVC2 project in VS2010 - not VS2008.

Resources