As this is the first post to our development blog on our new website, I thought I might comment on some of our experiences in getting the new site up and running.
Our site is almost entirely based on Community Server 2.0, a really cool product that we use both for this website and for the sites of some of our customers.
We chose to use the SDK release of CS 2.0 (rather than the web install package) so that we could make some relatively minor additions and modifications. We also wanted to use ASP.NET 2.0, as our hosting provider supports 1.1 or 2.0 but not both, and we plan to extend our site with new services that will require 2.0.
Now before I go any further, I'd recommend if you are using a shared web host (ie. not a dedicated server) that you stick with ASP.NET 1.1 if at all possible, or at least wait a month or so for CS 2.1, or even CS 3.0 (but that release is many months away). If your hoster offers a CS installation option and you can live with not being able to directly modify the pages within the site, then go with that. But if you want to live on the edge, it's certainly possible to use the SDK and .NET 2.0 together...
In fact, it didn't take long at all to get a development server up and running with CS 2.0 and .NET 2.0. As is often the case though, the main issues running CS under .NET 2.0 are really only apparent when you migrate from development to your production hosting site.
Most hosters require that ASP.NET sites run under medium trust, or some sort of variant of it. It's possible (and a good idea) to simulate medium trust in your development environment (add <trust level="Medium" originUrl="" /> under system.web in your web.config), but be aware that it won't be an exact simulation of your production host as they may have made some policy adjustments via the host machine.config file. (You could of course ask your hoster for a copy of their machine.config....)
We chose to use the ASP.NET 2.0 membership provider model (via CommunityServer. ASPNet20MemberRole), which has been suggested as one way of getting medium trust working. We also wanted to go this way to help integrate other aspects of our site.
Let's just summarise our environment then:
- commercial shared web host running ASP.NET 2.0 and SQL Server 2000
- ASP.NET configured as Medium Trust (with some minor increases in trust level provided by our hoster for database access and outbound http/s)
- Community Server 2.0 Web built in Visual Studio 2005 from the CS 2.0 SDK
- ASP.NET 2.0 membership provider model
Use ASP.NET 2.0 to develop, ASP.NET 1.1 to run
Now here's an ugly trick that got us over a few hurdles. You can build the site in .NET 2.0 and Visual Studio 2005, use the ASP.NET membership provider, and use a .NET 2.0 web.config format, but have it all run under .NET 1.1. You do this by modifying your web.config to limit the supported runtimes:
<startup>
<supportedRuntime version="v1.1.4322" />
</startup>
Sorta defeats the purpose of building in .NET 2.0 if you can't use any .NET 2.0 features though, doesn't it.
Operation could destabilize the runtime.
What the? Sorry, could you repeat that? I am so learning to hate that message. A haiku message would be more useful. The message may be mysterious, but our experience indicates that it is somehow related to mixing .NET 1.1 and .NET 2.0 assemblies in the one \bin directory. (Shades of DLL Hell all over again...)
We saw this in both the Exceptions Report and Event Log. It happened when using a desktop blogging tool to access the CS Metaweblog API. We also noticed that an assembly wasn't loading - the ubiquitous and very handy XML RPC support library from Cook Computing. This seemed to be due to it being strongly named. By grabbing the source, building it in .NET 2.0 and removing the key file reference (alternatively, adding your own key), we were able to get it going.
So we got this far OK... let's check that log one more time....no more runtime destabilization.. YAY!
But wait,....oh-ohhhh.... - it's the EmailQueueProvider...
Message Iterator Failed. Type CommunityServer.Components.EmailJob. Method SendQueuedEmailJob. Reason System.Security.Permissions.SecurityPermission.
Hmm... that could explain why we can't get our site to send any emails.
Tune in next week to see if we solve that one!
Technorati : ASP.NET 2.0, Community Server, Medium Trust
Ice Rocket : ASP.NET 2.0, Community Server, Medium Trust