SharePoint WebParts. SharePoint 2003 & WSSv2 can only run SharePoint 2003 WebParts, which are essentially server controls that inherit from Microsoft.SharePoint.WebParts.WebPart. If you run VS2003 & SharePoint 2003 on the samebox you can get debugging support (don't even try to do this remotely - trust me).
Windows SharePoint Services v2, sp2 (WSSsp2v2) + ASP.NET 2.0 + Son of SmartPart (SoS). With Son of SmartPart you get two SharePoint 2003 WebParts that allow you to either load an ASP.NET 2.0 UserControl (SoS-UC) or an ASP.NET 2.0 WebPart (SoS-WP).
Windows SharePoint Services v3 (beta). In the future both Microsoft Office SharePoint Server 2007 (MOSS) and Windows SharePoint Services v3 (WSSv3) will run on ASP.NET 2.0 with a slightly altered ASP.NET 2.0 WebPart Framework. ASP.NET 2.0 WebParts will work in SharePoint but will be unable to communicate with each other. For part-to-part communication (known as Advanced Communication), Microsoft will require you to build a SharePoint WebPart (of the v3/MOSS kind).
* Information obtained from MOSS 2007 Developer Class given by Todd Bleeker (MindSharp) in Minneapolis, MN in July 2006.
If you are looking for a hybrid solution that will work today, and offer an easy upgrade in the future, your best choice is to configure WSSv2sp2 with ASP.NET 2.0 and Install SoS-WP. Then build an ASP.NET 2.0 WebPart.
So, since out of the box ASP.NET 2.0 WebParts do not load in WSSv2sp2 with SP2 and ASP.NET 2.0 - you will need Son of SmartPart. Here's what I've found using Son of SmartPart - WebPart (SoS-WP):
- The DWP and SoS-WP must have the TypeName set to Namespace.Class.
- The Assembly must be in the local BIN, GAC doesn't work.
- Trust must be set to full, and the assembly MUST be in the bin (This is not ideal, but I've found that no other combo works.)
- STSADM cannot be used to create the SafeControl entry (because it doesn't understand 2.0).
- In order to get Debugging to work, you have to:
- Run VS2005 & SharePOint on the same box
- Set the Project build property to start the URL in a browser
- Attach to the w3wp process. This combination has worked once for me, and hopefully will continue to work.
Unfortunately, WebParts (either SharePoint 2003/WSSv2, MOSS 2007/WSSv3, or ASP.NET 2.0 WebParts) do not have a design surface... because they are essentially Server Controls. In order to get a Design surface (So we can actually build a decent UI), you could use Page.LoadControl inside the WebPart (either in CreateChildControls() or RenderContents() method) - but it doesn't seem to work with UserControls that have a code-behind (inline page models work). My best guess here is that I need to publish a website* that contains the control separately (from the ASP.NET 2.0 WebPart project) and copy the ascx (with the compiled assembly name reference) to the UserControls folder, its assembly into the local bin, and then the Page.LoadControl in the WebPart should work. This seems like an incredible pain in the ass, but may be my only option. I will continue testing and report back here, so stay tuned.
* This is due to the partial-class/page-level compilation model of ASP.NET 2.0. The "Publish Web Site" option under the build menu for an ASP.NET 2.0 WebSite in VS2005.
In my journeys, I have been unable to get page theming to work in WSSv2sp2. As you probably know, WSSv2 was originally designed in ASP.NET 1.x (which didn't have theming/masterpages), and was only recently retrofitted with SP2 to even run ASP.NET 2.0. If anyone figures this out - PLEASE, let me know.
Thankfully many of the compromises and half-stepping that a SharePoint developer goes through today will go away with MOSS 2007. My biggest pet peeve - the lack of design support - unfortunately will not. WebParts will most likely always be based on strictly-code-based Server Controls. Yes, I know - it's a HUGE barrier to entry for the teaming masses.