Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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.

share|improve this question

3 Answers 3

up vote 0 down vote accepted

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.

share|improve this answer
    
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 Oct 13 '10 at 14:41
    
What is the issue with 32/64 bit? Just leave the project on "Platform Target = Any CPU" –  Muhimbi Oct 13 '10 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 Oct 13 '10 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.

share|improve this answer
    
It would also be safest to develop against SharePoint 2007 so as to avoid accidentally using any new 2010 APIs –  Steve P Oct 13 '10 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:

(http://www.codeproject.com/KB/sharepoint/MOSSFlashWebPart.aspx) 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 (http://www.sharepointinstaller.codeplex.com). 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: (http://geeks.netindonesia.net/blogs/andriyadi/archive/2010/02/27/sharepoint-2010-solution-installer.aspx).

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?

share|improve this answer
    
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 Oct 13 '10 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 Oct 13 '10 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 Oct 13 '10 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 Oct 13 '10 at 14:09

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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