0

Hi everyone I'm trying to publish my site via ISS7. I have deployed all necessary dll files but I get "Resource cannot be found". Could you help me please

Server Error in '/WebCity' 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: /WebCity/Views/Home/Index.cshtml -------------------------------------------------------------------------------- Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272 
1
  • are you using the built in web dev server of Visual Studio or you have deployed the application on localhost i.e iis ? Commented Aug 23, 2012 at 7:18

2 Answers 2

0

A .cshtml file should never be requested as a URL.

Instead, request a route that maps to a controller action (presumably the one that renders the .cshtml view you are attempting to locate), e.g.

/WebCity/Home/Index

Sign up to request clarification or add additional context in comments.

1 Comment

@FurkanSönmez: I did show an example. If you are requesting a relative URL it would probably be (depending on your routing configuration) /WebCity/Home/Index. If you are requesting a fully qualified URL (e.g. if you are making an Ajax callback from JavaScript) it would be http://mydomain.com/WebCity/Home/Index
0

if you look in the Global.ascx file you will see the default routes setup like

 routes.MapRoute( "default", "{controller}/{action}/{id}", new { action = "Index", id = "" } )} ); 

therefore the requested URL in your case would look like

/Home/Index ^ Controller Action ^ Controller 

if your application is deployed at localhost then it would probably look like

http://localhost/Home 

or

http://localhost/Home/Index 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.