5215 Views // 0 Comments // Not Rated

SharePoint 2007, Windows Server 2008, AJAX 3.5, And Ibuprofen

I just finished getting AJAX 3.5 working on SharePoint 2007 for an internal project I'm working on, and now I learn that we are going to be migrating our server from a Windows Server 2003 VM to a brand spankin' new Windows Server 2008 box. So I reimaged my machine with WS2K8, installed SharePoint, and got everything working.

This post will be just a list of things that I ran into moving a user control and a workflow with a custom edit form from WS2K3 to 8. The biggest thing to point out about Windows Server 2008 is that we are starting out in .NET 3.5. Windows Server 2003 shipped with 2.0, on which SharePoint was built.

(The only reason SharePoint 2007 requires the 3.0 Framework is for WF; it is a 2.0 web application.) So when you get all your SmartParts, custom code, and workflows working on 2003, everything is by default talking to the 2.0 or 3.0 versions of the framework, which are already installed.

When you start targeting 3.5, things get hairy. However, if you read my blog entry above, it's not too hard to get 2.0 and 3.5 SharePoint content running side by side. The problem with WS2K8 is that we are already in ASP.NET 3.5; anything talking to the ASP.NET AJAX Extensions 1.0 will fail!

So here are some of the bridges you'll have to cross to keep your controls that were happy on WS2K3 from becoming grumpy on 8:

  • Windows Server 2008 only supports WSS 3.0 / MOSS 2007 SP1.  Either wuss out (like I did) and download WSS 3.0 SP1 directly from Microsoft, or Google around on how "slipstream" your MOSS 2007 installer to include SP
  • AJAX Control Toolkit.  You'll either have to download the 3.5 version from CodePlex and install that, or get the source of 1.0 (which targets .NET 2.0) and recompile it targeting the 3.5 Framework.  I actually did the latter, since I had made a lot of customizations to several of the controls.  It was actually simple:
    • Open the project in VS2008
    • Target 3.5 in the project's properties
    • Rebuild
    • Reference it in your project
    • Update version numbers in your project and GAC the new assemblies.  
  • SmartPart.  I have the latest version from CodePlex installed (Return of SmartPart 1.3 with AJAX support).  This hopelessly needs the 1.0.6.whatever version of the ASP.NET AJAX 1.0 runtime, so I had to break down and install it on my box.  Download that here.  I guess you could download the source code (literally...it's just a bunch of C# files) from the aforementioned CodePlex site, add them to a new project, recompile targeting 3.5, and try to deploy...but I wouldn't.  This was annoying, since I wanted to get everything up without having to install any old AJAX to hack components to work.
  • Workflow.  Here is a terrifying error I saw in my SharePoint logs:

    Engine RunWorkflow: System.IO.FileNotFoundException: Could not load file or assembly 'System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

    Why the hell WF was looking for AJAX I don't know and I don't want to know.  My custom workflow project was and had always been targeting 3.0; I changed this to 3.5, recompiled and reGACed and the problem went away.
  • FileNotFreakinFound.  This error sucks, since you don't know what wasn't found, and it doesn't seem to bubble up to the Event Log or the SharePoint logs.  Even if you go into your web.config, and switch CallStack attribute to true in the <SadeMode> element toward the top, all you'll get is a stack trace of a bunch of reflection errors.  As far as AJAX goes in this discussion, it's always been System.Web.Extensions 1.0.6.whatever for me.  Either install ASP.NET AJAX 1.0 (3rd party code) or target .NET 3.5 (your code).
  • Web Part Gallery.  Site Settings -> Web Part Gallery -> New.  This page actually threw the FileNotFound error mentioned above.  Installing AJAX 1.0 fixed it.  I only noticed this on WS2K8 after installing the SmartPart but before AJAX 1.0; it appears as though the page was blowing up because one of the web parts couldn't find it's references...weird.

So the moral of the story is that if you are moving AJAX SharePoint 2007 content from WS2K3 to WS2K8, get over yourself and install ASP.NET AJAX 1.0 on your server. Despite the assembly binding redirects in my other blog, you still need the old System.Web.Extensions and System.Web.Extensions.Design DLLs in your GAC for everything to work easily. Have fun!

3 Tags

No Files

No Thoughts

Your Thoughts?

You need to login with Twitter to share a Thought on this post.