Not able to deploy MVC3 to IIS correctly - asp.net-mvc-3

I've followed the steps to bin deploy my MVC3 application into IIS7, but when I browse it after deployment, it is showing me a list of file similar to ftp website instead running the pages.
The dlls that are explicitly added in the bin folder of my application are:
Microsoft.Web.Infrastructure
System.Web.Abstractions
System.Web.Helpers
System.Web.Mvc
System.Web.Razor
System.Web.Routing
System.Web.WebPages.Deployment
System.Web.WebPages
System.Web.WebPages.Razor
I set security to everyone full control to test, so its not a security issue for sure
and when I try to navigate to home/index for example, IIS wont recognize the path, see error below:
.net 4 is installed, application pool of the website is .net 4 also
not able to find solutions
What I am missing to do, any suggestions ?
Thanks

In order for IIS (this only applies to IIS 7+) to process MVC request, the easiest option is to set your Application Pool pipeline to Integrated instead of Classic. Without giving an MSDN level reason as to why this is, essentially classic mode wants every request to have a file extension. If the request does not have a file extension, IIS will go look for that directory. Integrated mode allows the request to go into the ASP.NET pipeline, which will then trigger your routing in your MVC site and the dynamic content will appear.

Related

Hosting a website built with webmatrix

I had built a website using Webmatrix 3 and used the '.sdf' database. However, I couldn't use the web deploy technique since my host doesn't allow it.
The files have an extension of '.cshtml'
I've uploaded the files using ftp and when I open the link to those pages, they only show the code like they show when they are opened manually by double clicking on them not even on a localhost.
Is there a way I can host my website with the .sdf database?
Sorry, the ASP.NET Web Pages framework (the pages you're talking about '.cshtml') needs your to have the Web Pages framework installed so that they can run.
IIS needs the Web Pages add on to work with the .cshtml files, and to render the HTML using the Razor syntax, that you're trying to tell me. I remember, once I opened the .cshtml page using Opera Web Server, and it gave me the same error since it was not able to render the HTML and thought the code itself was the HTML.
The problem about the .sdf is that you cannot use it. If they don't support Web Deploy, I think they don't support the SQL Server CE database either. This means that you cannot use them.
As, alread told, you can only ask your hosting service provider for help in this scenario. They can guide you further. Or can forward you to some other branch where these services are supported.

Deploying Asp.net MVC web application

I have been trying to find a neat tutorial, guide or step by step instructions for deploying an Asp.net MVC3 webapp but have found nothing so far. Everyone talks about his version of the stroy and different type of MVC versions.
Right now, I have build a simple Asp.net MVC web application which i need to deploy on my shared hosting account. In a very simple manner, I need to know which files should i copy. Do i upload everything in my webproject directory to the server including the controller directory, views, models, content and bin directory ?. What about the Global.asax, web.config, packages.config, myapp.publish.xml.
In short, I have no idea which files should be uploaded and which should be not. I am sure of one thing that i need few(MVC and Razor dlls) following dlls in bin directory. Just treat me as someone who has never deployed any website
NOTE:- I don't have VS SP1 installed and it doesn't install either. Basically i need a manual procedure.
Here is a tutorial on the MSDN site about how to deploy an MVC application. Typically, hosts will also now have WebDeploy available, which is a very easy way to deploy and update your application without having to worry about what files to copy.

How to Package/Publish SQL databases with ASP.NET MVC 2 Website?

I'm trying to deploy my ASP.NET MVC 2 Website for the first time on a local IIS 7 server, which is configured and running. I've made successful deployments using the Web Deploy option without the databases (so the site isn't fully working yet). Most of the deployment settings are pretty intuitive, however, I have problems with the Package/Publish SQL -tab in the project settings. Here's how it looks like with the errors I'm getting (click for bigger view).
It asks for Connection String, but I have no idea what to put there. It also gives a weird error about another process using a schema file.
Any pointers are welcome. I'm looking for the easiest way to just get it running.
I was able to get the databases running by unchecking the "Exclude files from the App Data folder" in Package/Publish Web tab. It then simply copies the database files.

Deploy ASP.NET MVC 2 to IIS 7.5 targeting .NET 3.5

I created an ASP.NET MVC 2 application in Visual Studio 2008. I set the release build to go through the ASP.NET compiler to precompile all the views, minify Javascript and CSS, clean up the web.config, etc. Since the production deployment is going to an IIS6 server, I set up my pseudo-production deployment on my Windows 7 machine to have the application pool run in classic mode targeting the 2.0 runtime. I set up the extensionless handler in the web.config that's necessary and everything worked great.
The problem came when I upgraded the solution to Visual Studio 2010. I'm still targeting the 3.5 framework, but now I'm using MSBuild 4.0 since that's what Visual Studio 2010 uses. Everything still compiles correctly because it runs fine under Cassini, but when I deploy it to the same location (same application pool, identity, etc) it now behaves differently. I still have the extensionless handler in the web.config, but now when I navigate to the root of the application it does directory browsing, and any routes that it had previously handled now come back as 404 errors being handled by the StaticFile handler in IIS. I'm at a loss for what changed and is causing the break.
I have looked at this question, but I have already verified that all the prerequisite components are installed.
Did you try debugging your routes using Phil Haack route debugger on the server?
Edit:
On IIS 7.5 you dont need any special extensionless handler, this is handled automatically, you don't need to change anything. It is only necessary on IIS 6 as far as I know.
Could that be the problem? what if you remove that special handler? maybe this is what is stopping it to kick in the route engine.
Edit:
I double checked, and as I thought, starting on IIS7, the default mode of a AppDomain is Integrated Mode. This means that the Asp.net stack kicks in at every request, while in classic mode, asp.net was called only when an specific extensions where called (aspx ashx axd are mapped by default to the aspnet_isapi filter).
UrlRoutingModule is kicking in at every request without requiring anything from you because it is an HttpModule and not a Handler. (it just needs to be registered in the config file of your application, no need to map it to an extension, but that's by default in an MVC app. You can open you Web.Config file and verify that you have under a node
<modules runAllManagedModulesForAllRequests ="true">
...
<add name="UrlRoutingModule" type=.../>
</modules>
Are you sure you deploy the MVC assemblies to the server?
Check that System.Web.Mvc, System.Web.Routing and System.Web.Abstraction references have the Copy Local property set to true to be sure you use the same assemblies locally and on your production server...
If all that is correct, I don't know how to help you more... I hope this will help you, or at least put you on the right tracks.
EDIT:
Oww... just read your last comment... sorry I missed that element about classic mode. Your title mentions IIS7.5 and I assumed too much things. that's why I got confused.
Honnestly now, I had to look in the book of Steven Sanderson. He has a checklist for troubleshooting IIS6 deployment.
I know you're saying it's only when using MSBuild 4 that it fails, but it might still be usefull
Check that Default.aspx is set as default content page. That could be the source of 404.
Then to have extensionless urls, last time I deployed to IIS6 I used a simple wildcard map and I never had a problem...
If you're still in trouble sorry that I could'nt help... not that I didnt try :) good luck
I experienced this problem today, in a similar scenario.
The problem on my case was due the fact that asp 32 bits was registered instead of the 64 bits, causing the problem with the routing.
It was solved by typing the following in the command prompt
CD c:\windows\microsoft.net\framework64\v4.0.30319
aspnet_regiis -i
Couple ideas to try
Have you run any kind of comparison
between the output of the VS2008 and
VS2010 projects? Just verifying that the
solution upgrade didn't change
anything.
Do you have the web.config
targetFramework attribute set on the
compilation element?
Are you certain you're not running
into something like running a x86 application
in a x64 app pool?
I'm guessing you're fine on those, but since Cassini has no problems with the application, I still lean toward web.config issues. Do you have your modules/handlers properly registered in the element? Since you're running Classic Mode, you'll need both the "old" and the "new" (reference 1, reference 2).
I've already posted this solution in another thread, but I'll repeat myself.
Use classic pipeline mode of AppPool:
Also dot't forget to install HTTP Redirection module in Turn Windows features on or off.

IIS Not working

I have a web site that built on Visual studio 2008 and
i need to run it from my computer (Win 7 Ultimate) as a server
I tried to publish it to IIS and this is simply not working
and i have the flowing error :
Error Summary
HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.
Config Error This configuration section cannot be used at this path. This happens when the section is locked at a parent level. Locking is either by default (overrideModeDefault="Deny"), or set explicitly by a location tag with overrideMode="Deny" or the legacy allowOverride="false".
any one can help?
It looks like the Web.config file contains some disallowed section. Some sections can only be set in the machine-wide configuration, some can only be set at the root of a web site, etc.
Simplify your web.config as much as possible (make it as empty as possible) and when the page displays, add one section at a time.
Silly problem but IIS never warn about it
i have missed installing the component (from control panel) that support ASP.NET
when i installed it ,it worked :)

Resources