Is it possible to have the same web part (.wsp) for both (MOSS 2007 & SP 2010)?

Assume that I want to develop a simple web part, and I want to deploy it on MOSS 2007 and also on SP 2010? So, is this possible? Or are there any issues?

I would greatly appreciate if you explain to me.

3 Answers 3


No problem. You may need to update your installation script though. For details see the series on Porting a SharePoint 2007 WSPBuilder solution to SharePoint 2010.

  • Thanks for your input, But still the environment will be a problem! I mean: I want to create 1 single WSP, But I am not sure on which environment this WSP will be installed in, it might be 32-bit or 64-bit... you see the problem ?
    – Alex
    Commented Oct 13, 2010 at 14:41
  • What is the issue with 32/64 bit? Just leave the project on "Platform Target = Any CPU" Commented Oct 13, 2010 at 15:04
  • I think I over-emphasised that issue, for a moment I thought the default setting in VS was for x86
    – James Love
    Commented Oct 13, 2010 at 16:59

The main thing to watch out for is the CPU type in your build. If you build for 32 bit CPUs for your MOSS2007 environment, you will need to rebuild for 64 bit processors for your SharePoint 2010 environment.

  • It would also be safest to develop against SharePoint 2007 so as to avoid accidentally using any new 2010 APIs
    – Steve P
    Commented Oct 13, 2010 at 16:39

Thanks James for your input, but could you please elaborate your point of view more ?

Also, I want to clarify my question by giving an example, which is as follows:

Here is a web part for MOSS 2007, assume that I have reused the same source code, then I packaged the solution using SharePoint Solution Installer. Now I have a deployable package of a web part for MOSS 2007.

I want the same web part for SP 2010? How?

At the moment, I am creating another solution, and using different packager tool.

So, my question is how to have one web part that could work on both MOSS 2007 and SP 2010 ?

BTW, there is another crucial issue which is related to supporting Multilanguage. Assume that I want my web part to support English, German and French. So, basically I will use resource files (.resx), that means: for the MOSS 2007 WP I will deploy these resource files in ..\12\TEMPLATE\LAYOUTS.., BUT for SP 2010, there’s 14 Folder.

Therefore, how to tackle these issues, and create one single web part that works on both MOSS 2007 and SP 2010?

  • If your MOSS 2007 environment and your SP2010 environments are both using 64bit architecture, you won't have many issues (but this of course depends on the complexity if your web parts).If your MOSS2007 environment is 32bit, the web part will fail in SP2010 as SP2010 is 64bit only.
    – James Love
    Commented Oct 13, 2010 at 13:47
  • Also, if you have a WSP for 2007 it probably will deploy ok to 2010, but like I mentioned, if you have 32 bit binaries in there, they won't work.
    – James Love
    Commented Oct 13, 2010 at 13:54
  • James, Is there any way to let the web part detect if the environment is 32-bit or 64-bit ? So, the idea is that: If the WP is installed on 64-bit (MOSS2007 or SP 2010), then, it will work. But if it gets installed on 32-bit (MOSS2007), then, it displays a friendly error message that the current environment isn't support. Is this possible ? How ?
    – Alex
    Commented Oct 13, 2010 at 13:58
  • Unfortunately there is no way to code this into the web part's assembly itself - SharePoint will attempt to load it before it runs any code within it. If you set the compile option for "Any CPU" then this should be able to work on both 2007 and 2010. Try this first as a solution.
    – James Love
    Commented Oct 13, 2010 at 14:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.