Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sharepoint 2010 Foundation with .Net Framework 4.0

I am having a Web Application with build target as .Net Framework 4.0. I want to interact with the Sharepoint Object Model API's but it gives a framework 4.0 runtime does not supports Sharepoint.dll error.

Is their any tweak such that I can use Sharepoint 2010 with .Net Framework4.0.

Note: I cannnot change the build target of the web app to any other framework as I am using some exclusive features of .net 4.0 in my application.

like image 429
Dhaval Pandya Avatar asked Oct 28 '10 11:10

Dhaval Pandya


2 Answers

Sorry you probably will have no luck:

There appears to be some confusion around whether or not ASP.NET 4 is supported for both MOSS and SharePoint 2010 - in short, the answer is that it is not currently supported in either product.

Whilst it is possible to use ASP.NET 3.5 in MOSS by making some modifications to the SharePoint site web.config (instructions for doing that in MOSS here; SP2010 uses 3.5 by default), this is unfortunately not the case with version 4.

The reason? ASP.NET 4 uses a new version of the Common Language Runtime (CLR). Whilst .NET 2.0, 3.0 and 3.5 all used version 2.0 of the CLR, .NET 4 uses version 4. I'm not entirely sure what happened to version 3. There is a decent post on stack overflow with further details.

from SharePoint 2010 and .NET 4: confused?

Maybe .NET 4.0 Support will be added in a future update (SP1?) who knows...

like image 69
Dennis G Avatar answered Nov 14 '22 14:11

Dennis G


Unfortunately, .Net 2.0 to 3.5 use a different application pool type from .Net 4.0; Mixing in the same app pool is not going to work.

What features of .Net 4.0 are you using, and perhaps the community can help you with a 3.5 solution?

like image 45
Iain Ballard Avatar answered Nov 14 '22 13:11

Iain Ballard