Question

I'm curious if anyone has seen any guidance/best practices on developing web parts that can work for both SP2007 & SP2010 with minimal conversion? They wouldn't take advantage of any new 2010 functionality. Rather, I'm thinking about forward migration - taking parts written for 2007 and ensuring that they can run on 2010. Recompilation to target new SP DLLs is OK but I'd rather not maintain two completely separate code branches.

Was it helpful?

Solution

You don't have to do anything. Your 2007 Web Parts will run in SharePoint 2010 as long as you are not using any of the deprecated APIs (such as the old SSP stuff).

SharePoint 2010 ensures (using assembly redirection) that the referenced v12 DLLs will use the new v14 assemblies. So you do not even have to recompile your stuff. Just deploy them...

OTHER TIPS

The new Visual WebPart designer is really just a "pattern" that makes it easy. You can use the exact same code + ASCX method with a WSP project today - for 2007. It's just .NET code that you load the control.

The only bit you DON'T get is the actual visual design / drag+drop within Visual Studio.

Another thing to note is that .NET 4.0 is what would be targetted by VS-2010 - whereas you should remain at .NET 3.5 for SharePoint 2007 AND 2010.

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top