0
votes

I have the following problem:

I'm trying to create a WCF WebService to retrieve information about SPWeb and SPSite within SharePoint 2010. But... it doesn't work, because it tolds me that I'm using the bad .NET framework but I'm actually using the 3.5 (obviously SharePoint only works with .NET 3.5 framework for the time being).

I got the following exception message :

Microsoft SharePoint is not supported with version 4.0.30319.269 of the Microsoft .Net Runtime

Here are some pictures describing my issue:

WebMethods

Exception

4

4 Answers

0
votes

Have you checked the .Net Version that the App Pool is configured to use?

0
votes

It is possibly that you have changed .NET framework, build solution and try to debug it within Visual Studio without deploying solution to the farm. I don't know, if I'm not right, correct me. But if you do so, it could be a reason, that you haven't your solution redeployed to the SharePoint farm. So your assembly wasn't deployed to the GAC. Notice, if you didn't deployed solution, you have old DLL in GAC, Visual Studion when you debug solution looks firstly to the GAC, and after that to the local DLLs. So it is possible that you have old version of DLL in the GAC.

0
votes

I've run into this error before -- verify that all of your project's references are targeting .Net 3.5. I'm not sure it would be a problem with the app pool as @Matt-Klepeis suggests or SharePoint wouldn't start at all.

0
votes

I thought when working with Sharepoint outside the object model you had to explicitly target an x64 CPU (in advanced compile options, assuming you are using Visual Studio)

Have you tried this?