1

Hello everyone I want to ask how to publish a MVC3 project on IIS 7

I have done these steps:

Installed neccessary dlls Microsoft.Web.Infastructure System.Web.Helpers System.Web.Mvc System.Web.Razor System.Web.WebPages System.Web.WebPages.Deployment System.Web.WebPages.Razor Changed Framework 

But it still does not publish

3
  • 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/Home/Index.cshtml Commented Aug 24, 2012 at 11:54
  • you dont have to include the .cshtml in the requested route it should be like /localhost/Home or /localhost/Home.Index Commented Aug 24, 2012 at 11:56
  • possible duplicate of IIS 7 Resource cannot be found MVC3 Commented Aug 24, 2012 at 11:57

2 Answers 2

1

When you deploy it you can keep your projet in root folder where local disk C: or whatever and please dont forget to which framework you are using and you can change the framework at application pool

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

Comments

0

Requested URL: /Views/Home/Index.cshtml

Your requested URL is wrong. You cannot directly access Views. You should pass through a controller action, so the correct url that you need to type in your browser is /home/index.

You may take a look at some of the tutorials about ASP.NET MVC here: http://asp.net/mvc

6 Comments

Allright but where I have to change request URL in Global asax ? public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "Home", action = "Index", id = UrlParameter.Optional} // Parameter defaults );
You don't have to change anything. The default routes make it so that if you request / in the browser, the Index action of Home controller will be executed. You type the url in your browser address bar.
I get another error Could not load file or assembly 'System.Web.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
Do you have ASP.NET MVC 3 installed on the server?
And how do you expect this to work without installing it? You want to do bin deployment? Make sure that all necessary assemblies are present in the bin folder for this: haacked.com/archive/2011/05/25/bin-deploying-asp-net-mvc-3.aspx
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.