I just survived a huge ordeal with setting up MVC 3 to play nicely on IIS 6, so I thought I’d blog about it to make sure nobody else endures this mess. I’ll go through these steps in order so you can roll through this issue as fast as possible. I’ll save my long winded drivel til the end.
- I assume you’ve got VS 2010 SP1 on your dev box, MSBuild and .NET 4.0 on your build box.
- Install MVC 3 on your dev web server, whether that’s local or remote or use one that has it if you’re paying for hosting.
- If you cannot install MVC 3 on your target web server, you can do a bin deployment as Scott Hanselmen explains, but that is really only useful for small projects when you’re deploying from your local dev machine. Some people posted examples of how to setup MSBuild with a task CollectFilesFrom_binDeployableAssemblies, but the examples were either incomplete or I was too incompetent to figure them out, so I setup a simple copy step to make this happen (note – you’ll have to make msbuild variables for values like BinDeployableSource):
<Copy SourceFiles="@(BinDeployableSource)"
DestinationFolder="$(SourcePath)\$(WebProjectBin)"
SkipUnchangedFiles="true" />
- Now here’s the kicker and what was really killing me. You need the web.config from inside the Views folder! My robocopy deployment scripts wasn’t setup to include web.config’s from inside the Views folder. I have to credit Andrew Barber with figuring this out.
My setup: I’ve got VS2010 on a dev box. We’re using SVN and its kicking off a CI build on our build server, which then uses robocopy to deploy our web assets out to the dev web server. If you’re having any issues fixing this, please comment on here or contact me and I’ll try to help you out.