I want to make an event reciever DLL for both SP2010 and SP2013. currently I have two separate projects one for each as each one is targeting different framework due to the fact that each of them is built using different .NET framework. can I use one project/solution to produce these two different DLLs?
Asked
Active
Viewed 254 times
2 Answers
1
Use conditional compilation in visual studio to switch between dlls of target framework.
Refer below links for help:
Conditional Compilation and Framework Targets
Conditionally changing target framework version
visual studio 2010 compiler conditions based on target framework

Community
- 1
- 1

Kunal Valecha
- 207
- 1
- 8
-
The first link is duplicating the code at the end using xcopy. – Mahmoud Fayez Jan 08 '14 at 20:05
-
thanks this link is the right one: http://stackoverflow.com/questions/18588803/conditionally-changing-target-framework-version – Mahmoud Fayez Jan 09 '14 at 08:13
0
Because of the fact that a) you have to have the target SharePoint version installed on your dev and build machines, and b) it's impossible to install two SharePoint versions on the same machine, then no, you cannot build two DLLs targeting SharePoint 2010 and 2013 at once. Keep going with two separate solutions, just share the source code and if necessary, use conditional compilation to reflect changes between SP2010's and 2013's APIs.

Ondrej Tucny
- 27,626
- 6
- 70
- 90
-
Actually the company build box has no share point and we build both of the projects on the build box, we managed to do so by copying all DLLs into a lib folder and reference the SDK from their. – Mahmoud Fayez Dec 18 '13 at 23:29
-
The problem is the two projects are identical except the target framework version it is 3.5 and 4 respectively for SP2010 and SP2013 – Mahmoud Fayez Dec 18 '13 at 23:30