Click here to Skip to main content
15,893,381 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello! I use ASP.NET MVC4 C#.
I wrote a simple source and try to start it and get next 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: /

Can you tell me, how it fix?
Posted
Comments
vijay__p 5-Apr-13 2:48am    
The URL which are you are trying to access must have corresponding controller and action.
Check your route configuration in Global.asax and URL (controller and action)
[no name] 5-Apr-13 4:16am    
So, I have controller UsersController.cs
and there is a Views/users/Index.cshtml
But why it does not find this controller?

hi,
please can you specify what environment you are using. in vs you need to check the global.asps.cs and set which page to start up(default page)like we use index.htm as default in normal html. It is in RegisterRoutes() of global.asps.cs
If is didn't solved your problem, can you post your codes in detail.

thanks
 
Share this answer
 
v2
Try setting relaxedUrlToFileSystemMapping to true in web.config file:
XML
<configuration>
   <system.web>
    <httpruntime relaxedurltofilesystemmapping="true" />
   </system.web>
</configuration>



--Amit
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900