The resource cannot be found - asp.net-mvc

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

Related

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

HTTP 404 error while trying to debug MVC 2 application page

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.

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.

MVC - Routing not working within intranet

I don't know anyone can help but I'd appreciate any. I am developing an app in mvc (c#), now I had various routes working on my local development machine when the app was stand alone however now I've tried adding the project to the test intranet at work and none of the routes are working.
So where Localhost/Admin/Create worked fine locally where admin is the controller and Create is the action, when I try to get to testintranet.mywork.com/intranetsection/myproject/admin/create I'm getting a file not found error. I'm not sure what I need to change to get it to pick up the routing again rather than look for the literal path. The default.aspx page works fine and gets called but apart from that nothing. Is routing only viable when in a standalone project?
Cheers for any help.
It looks like you're either running on IIS 6 or IIS 7 classic mode. If you can, I'd recommend updgrading to IIS 7 integrated mode. If not, I have a walkthrough for getting up and running on IIS 6.
http://haacked.com/archive/2008/11/26/asp.net-mvc-on-iis-6-walkthrough.aspx
You don't say what version of IIS you have deployed to, but you may be running into the issues described here:
http://blog.codeville.net/2008/07/04/options-for-deploying-aspnet-mvc-to-iis-6/
I believe that most people chose to resolve this using a wildcard mapping for the aspnet_isapi.dll.

Deploy asp.net mvc beta to iis 6 causing 404's

I'm struggling to get around the 404 errors from asp.net mvc beta when deploying on IIS 6. I had this working in one of the previews by mapping .mvc in IIS but this no longer works. I've read Omar's post and several others on the web and tried their solutions but no luck so far.
The home page opens without a problem on IIS 6 but others 404 and the site runs well on IIS 7.
Has anybody deployed asp.net mvc beta to IIS 6 with success? If so, what adjustments did you need to make to the code and/or IIS settings to get it to work?
I found a solution to my problem from Steve Sanderson's blog (Thanks Steve):
Use a wildcard mapping for aspnet_isapi.dll. This tells IIS 6 to process all requests using ASP.NET, so routing is always invoked, and there’s no problem. It’s dead easy to set up:
open IIS manager (run -> inetmgr -> OK)
right-click your app, go to Properties
then Home Directory tab, then click Configuration.
Under Wildcard application maps, click Insert (not Add, which is
confusingly just above)
then enter
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll for
“Executable”, and uncheck Verify that file exists.
I can't seem to write comments yet. So I'll write a new answer.
There are a few similar questions going around on stackoverflow.
I'm using MVC 3. I know the question was MVC 2 related. But since this is the first stackoverflow post I bumped in to, I think it's worth mentioning that:
when you use MVC 3, you need to add a new extension mapping with the executable of the .NET 4 framework (C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll)
<edit>I just found out that I even don't need to set up the extension mapping. </edit>
It still didn't work for me then :) I still had to 'Allow' ASP.NET v4.0.30319 in the Web Service Extensions section in IIS:
open IIS
click on the server node
open the Web Service Extensions section
select the ASP.NET v4.0....
right click --> Allow
Good to go!
Url rewriting can help you to solve the problem. I've implemented solution allowing to deploy MVC application at any IIS version even when virtual hosting is used.
http://www.codeproject.com/KB/aspnet/iis-aspnet-url-rewriting.aspx

Resources