Configuring IIS6 for WebMatrix
The news of WebMatrix was just released, causing a lot of interest in the tech community. See Scott Guthrie’s blog post for details on WebMatrix, IIS Express, SQL Server Compact and the Razor syntax.
The nice thing about all of these technologies is that they use managed code and are xcopyable, even to a web host that isn’t fully prepared for it. Even the SQL Server CE engine is xcopyable. However, at Orcsweb, we’ve been working hard to make the deployment story for WebMatrix extra easy under the name of Cytanium, an Orcsweb venture. We offer free accounts for testing WebMatrix publishing.
I had someone ask me today about setting up their site on an IIS6 server. Turns out that it’s very straight forward. I haven’t tested a lot of scenarios yet to see if there are other settings that I missed, but so far everything looks good.
Configuring IIS 6.0 for WebMatrix and MVC
WebMatrix uses .cshtml and .vbhtml as the file extensions, it is also uses the new extensionless routing engine, plus many of the current apps that you’ll find in the Web Platform Installer (WebPI) use MVC or other extensionless methods. Therefore, the easy solution is to add ASP.NET as the wildcard handler.
Note that if you add a wildcard handler, default docs won’t work for traditional webforms apps unless you specifically handle them. So, just add wildcard handlers to your WebMatrix folders.
To add a wildcard handler, fire up IIS Manager, navigate to the folder that you want to add the wildcard mapping, right-click and click Properties.
Then you need to get the path to the framework version. My favorite way to do that is to pick an existing extension, like .asax (right up at the top) and edit it. Copy the path from the “Executable” field into your clipboard. It will be something like this:
|.NET 2 ||C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll |
|.NET 2 x64 ||C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll |
|.NET 4 ||C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll |
|.NET 4 x64 ||C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll |
Cancel out of that dialog box once you have the path in your clipboard.
In the Wildcard section of the Application Configuration, insert the extension and uncheck the “Verify that file exists” checkbox.
Save out. That’s it!
Everything else will be the same as with IIS 7.x. The next challenges to watch for that that may come up will likely be related to the framework version, whether everything was correctly deployed, database connection strings, and whether sites in subfolders are marked as applications.
Hope you enjoy the WebMatrix testing and deployments!