I am working in Windows Application. My req. that i need to create the SharePoint 2007 and SharePoint 2010 layers for that project.
Can we use the SharePoint 2007 and SharePoint 2010 version of dll in One Project?
I am working in Windows Application. My req. that i need to create the SharePoint 2007 and SharePoint 2010 layers for that project.
Can we use the SharePoint 2007 and SharePoint 2010 version of dll in One Project?
So you want your application to work on both SharePoint 2007 and 2010, correct?
You have two choices :-
A) The simplest is to just reference the SharePoint 2007 DLL's in your project and make a small change to the package manifest to remove the SharePointProductVersion attribute.
This will then work fine on SharePoint 2007 and on SharePoint 2010 there are BindingRedirects already setup so that 2007 web parts will 'just work' on 2010.
See "Developing SharePoint 2007 Webparts using Visual Studio 2010"
However - this means that you can't use any of the new SharePoint 2010 features that were not around in 2007
B) A more advanced method is to use some MSBUILD ninja moves to output two 'targets' (versions of your program) - one targeting 2007, one 2010. You modify the .csproj file to reference the appropriate version of Microsoft.SharePoint.dll and use conditional compilation to keep the same source code with minor differences where necessary. Its pretty advanced stuff and rarely necessary so I am not going to go into details here - but you've got keywords for further research if necessary.