2

I am using some dll's from the crm 2011 sdk in a .NET 3.5 web part.The target is for SharePoint 2010 online. When I try to build it gives me the following error:

The primary reference "microsoft.xrm.client" could not be resolved because it was built against the ".NETFramework,Version=v4.0" framework.

This is a higher version than the currently targeted framework ".NETFramework,Version=v3.5". VisualWebPartProjectWebServiceTest.

I cannot upgrade my web part to .NET 4.0 because SharePoint 2010 is not supporting .NET 4.0. Is there some other solution to reference .NET 4.0 dlls in a .NET 3.5 sharepoint webpart?

Pedro Azevedo
  • 2,507
  • 1
  • 16
  • 22
Ola
  • 1,188
  • 5
  • 16
  • 35
  • Possible duplicate of [Making a call to a .NET 4 library from 3.5](https://stackoverflow.com/questions/2761640/making-a-call-to-a-net-4-library-from-3-5) – Liam Oct 12 '17 at 12:10

1 Answers1

3

I will say NO, you can't use .Net framework 4.0 dll in 3.5 but Yes in the other way around. There are a few workarounds to achieve this, but in a little different way. Check these following SO posts for further reference:

Can you use a .NET 4.0 dll in a 3.5 project?

How Can i use .NET 4.0 code in C# project which is built using .NET framework 3.5?

Making a call to a .NET 4 library from 3.5

Community
  • 1
  • 1
Santosh Panda
  • 7,235
  • 8
  • 43
  • 56