Search code examples
visual-studio-2010sharepoint.net-framework-versionmulti-targeting

Event Receiver for both SharePoint 2010 and SharePoint 2013


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?


Solution

  • Use conditional compilation in visual studio to switch between dlls of target framework.

    Refer below links for help:

    http://www.collaboris.com/blogs/collaboris-blog/mark-jones/2013/01/06/multiple-versions-sharepoint-visual-studio#.UrKQkvQW3O4

    Conditional Compilation and Framework Targets

    Conditionally changing target framework version

    visual studio 2010 compiler conditions based on target framework