Harish Kumar
Harish Kumar

Reputation: 2095

The resource cannot be found

I created a new ASP.NET MVC 2 Empty Web Application. I didn't add any line of code to it. I simply ran the application by pressing F5 .The browser opens and I get an error message stating that

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.

What is the problem?

Upvotes: 0

Views: 1220

Answers (2)

DKR
DKR

Reputation: 5734

I have created MVC2 web application. Account controller and Home controller is available by default and run the application is does not get any error.

And second time i have created MVC2 Empty web Application . None of controller,views and model are present in this project.After this i simply run application and i got same error as you say.Yes this error will come because none of controller,view and model is not present.So first try to make MVC2 Web application and second time try to make MVC2 Empty web application and add one controller ,view and model

Steps are below: 1)First make on model name as City under Model Folder for example:City.cs 2)Then make one Folder under View folder name as City 3)Make one view under City folder name as Index 4)Make one controller under Controller folder name as CityController.cs 5)Bydefault Index method is present in citycontroller so no need to make it. 6)After this run the application with browser url is localhost://City/Index

Upvotes: 0

Fraz Sundal
Fraz Sundal

Reputation: 10448

By default the empty project doesn't have any controller defined in it.

So first add it and then run it.

Upvotes: 3

Related Questions