Last post Mar 27, 2012 08:44 PM by CodeHobo
Mar 27, 2012 06:44 PM|mswhat|LINK
I have been enjoying learning .net 4 MVC over the past couple of months but have hit a major roadblock when I decided to try to deploy a simple app. It's as basic as it gets...for example:
http://mysite.com/helloworld/ should go to default index and http://mysite.com/helloworld/welcome should go to a "welcome" page.
If I publish it locally, (ftp method via Vis Web Dev Express 10) it works fine. Publish to the remote server, the directory structure looks exactly the same but it will not work. The message reads "HTTP Error 403.14 - Forbidden". (Enabling dir browsing
doesn't solve the problem).
My guess is the MVC routing isn't kicking in or it's a problem with the .NET config. What additional info would need to be provided for anyone to give me some pointers?
*Edit-I am publising to a subdirectory of an existing site.
Thanks for any input.
Mar 27, 2012 06:53 PM|CodeHobo|LINK
You need to make sure that IIS is configured to work in integrated pipeline mode and you need to deploy the mvc dll with your project
In addition make sure you use Url.Content when referencing any static resources (js, css, images).
Mar 27, 2012 08:29 PM|mswhat|LINK
Thanks CodeHobo. I checked the config for this application on IIS and it was in the classic pipeline mode. Switched it over to integrated and now my simple app is working as it should. Awesome.
Now maybe I can try a larger one like the Music Store or Movie tutorial at the asp.net site. With a database involved is it better to go ahead and create the database and change the connection string once the site is deployed?
The link was helpful too...I had been including the "ASP.net with Razor" dependencies but I see that's not necessary.
I also came across the IIS Isapi and CGI Restriction settings in IIS...ASP.NET 4.0 is not allowed. Do you think I should change that?
Mar 27, 2012 08:44 PM|CodeHobo|LINK
Mike - I'd say with the movie and music store tutorials just work with a local database, when you deploy it change it to a full blown sql server and because I believe both tutorials use the Entity Framework Code First, the tables will be built for you when
the application first runs.
I don't think you need to worry about Isapi or CGI unless your working with legacy code.