HTTP 404 error while trying to debug MVC 2 application page - asp.net-mvc

Tried creating a default MVC 2 application using the visual studio template and while setting up start page and browsing the application getting the http 404 (Resource not found error), have checked the controller classes for the naming conventions and also the option to set specific page in the project properties.
Kindly advice for any options to try out and also as I am new to MVC, so any help is highly appreciated.
Error Message
HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Hi, I am using the basic web template of Asp.Net MVC 2 Web Application template available in Visual Studio 2010 and have set up the start page.
Below the brief description of the error
Server Error in '/' Application.
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /Views/Account/LogOn.aspx
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1022
Do let me know if any additional information is required.
Regards
Arvind

Move:
/Views/Account/LogOn.aspx
To:
/LogOn.aspx
MVC uses routing to get to the Views folder. If you want to use legacy aspx HTTP handlers move it to the root folder.

I had the same problem, and I fixed it by this way:
In a first time, you have to check if your project configuration is correct:
Right click on the project properties, check if everything is ok.
Next, remove the file applicationhost.config. Visual Studio will re-create it automatically. You should find it in the folder "path_project/.vs/config" in the same folder of your project.

Related

Server Error in '/' Application. in mvc

In MVC application Host the IIS Server. It's showing folders I clicked views folder show the below error.
Server Error in '/' Application. The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its
dependencies) could have been removed, had its name changed, or is
temporarily unavailable. Please review the following URL and make sure
that it is spelled correctly.
Requested URL: /PMS/Views/
Version Information: Microsoft .NET Framework Version:4.0.30319;
ASP.NET Version:4.0.30319.17929
I'm not sure if it's relevant to yourself but I only get this error when I try to start the application on a page which requires a value to start.
For example you have a garage page that requires a garageId to set values/ show details. Because there is no value being passed to the page, that page cannot be found.

ASP.NET MVC can not find controller on Windows Server 2016

This is my first ASP.NET MVC project. It had been speedy development. However, when I deploy to the server, I just can't get the site to see the controller.
I did a test project. I just create an ASP.NET MVC project with no changes; published on to local IIS and it works. Same project on the server, didn't work. I have an index.html on the root to see if the site is up. Indeed, it's up. I can see index.html. When I go www.test.com/home/index (which is my test site), I get HTTP error 404.0 - not found. The resource you are looking for has been removed had it's name changed, or is temporarily unavailable.
bin folder does have project dll.
App_start/routeconfig.cs default url is point to home controller and the index action.
Project is straight out of the box. It should work.
Can someone point me in the right direction?
Sincerely appreciated.
In case someone is having the same issue.
There are so many reasons for error 404.
In my case, the network guy didn't install ASP.net framework. See there's a fine line between developer and network guy.
It's not exactly what I was searching for, but it solved my problem.
aspnet_regiis.exe -ir does not work on windows 8

Issue hosting ASP.NET MVC 4 application using IIS 7.5 after creating virtual directory - Script files are not working

I have an ASP.NET MVC 4 application that I am trying to host in IIS 7.5. I tried creating a virtual directory using "Use Local IIS Web server" option in Project properties and have set the Anonymous Authentication and Windows Authentication set in IIS.
When I run the application, it opens in the browser with the url, "http://localhost\ApplicationName" and I am able to view only the tab names I have created. When I right click and view the page source, I have my scripts listed and the body defined with divs and tables. When I click the tab names, nothing happens.
In the view page source, when I click any script, it throws an error,
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
Module IIS Web Core
Notification MapRequestHandler
Handler StaticFile
Error Code 0x80070002
Requested URL http://localhost:80/Scripts/Script.js
Physical Path C:\inetpub\wwwroot\Scripts\Script.js
Logon Method Anonymous
Logon User Anonymous
In IIS, I have enabled Anonymous, ASP.NET Impersonation and Windows Authentication.
Also, When I look at the Advanced settings for the directory, it shows the physical path in C\Users........ but in the Detailed Description, it shows the Physical Path as "C:\inetpub\wwwroot\Scripts\Script.js".
Am I giving the path wrong? or should I place the project files in "C:\inetpub\wwwroot\Scripts\Script.js"?
Please help. I have been struggling with this for a while now and it's driving me crazy.
Are you using URL Bundles or are you manually hard coding .JS paths in your front-end code? Are you seeing good/expected behavior when you run the site in debug mode within Visual Studio? I would try and gather some hints with those considerations and perhaps furnish some more information...

I am not able to run Asp.Net MVC 2 Application

I am trying an sample application in Asp.Net MVC 2 Application
given in http://www.codeproject.com/KB/aspnet/aspnet_mvc_tutorial.aspx
But i am getting the error as below
Server Error in '/' Application.
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /Views/PersonalInformation/Index.aspx
Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053
Please let mw know wat is the problem
The problem is the requested url. In an ASP.NET MVC application, the url corresponds to a controller action instead of the aspx page. See this link for an explanation: http://www.asp.net/LEARN/mvc/tutorial-02-cs.aspx.
The url should be something like http://localhost:xxxx/PersonalInformation (where xxxx is your port number)
To avoid getting this error everytime you start up your website through Visual Studio. Go to the properties of your web project and under the Web tab there is a property called Start URL. Change this to http://localhost:xxxx/ or something that is a valid MVC route.
Are you deploying to Cassini or IIS 6. Take a look at these articles
http://guyellisrocks.com/coding/deployed-asp-net-mvc-app-gives-404-on-about-page/
http://www.techdreams.org/microsoft/aspnet/how-to-fix-404-errors-of-aspnet-mvc-website-deployed-on-iis-6-windows-server-2003/2572-20090515
MVC runs fine in Cassini but requires some config modifications to run in IIS. I am still evaluating it in Cassini so i havent crossed that bridge yet but this info should help.

The resource cannot be found

I made a really simple MVC application with VS 2010 beta. just a view with 2 fields ID, and name made the controller and just tried to check the Index page. I am getting the following error. Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Version Information: Microsoft .NET Framework Version:4.0.21006; ASP.NET Version:4.0.21006.1
i am running on my laptop Windows 7 Home Premium I installed also IIS 7. is there some special option in order to work with MVC2. Any help would be greatly appreciated. Thanks
It might be possible that your routes are causing the problem.
If you could post your Global.asax, your controller and the url your are trying to access, then it would be helpful to answer more accurately.
Thanks

Resources