21 December 2013

An error occurred while processing this request

I recently started to develop a web form with knockout JS. The system is running on SharePoint 2010. The data given / taken  to  the form with JSON through WCF services.

I had a problem, I did not want that the service will be expose to web. To prevent exposure, created casing in the SharePoint an Application Page.

The WCF data services and any entity framework written in framework 4.5, and as you know that SharePoint 2010 and with the Application Page written in 3.5.

This means that every reference to in the form of entity framework like linq or lambda expressions written in framework 3.5 - which created (and still creates) a lot of problems.

I will present you one example of the problem we encounter - but Google unfortunately did not help.

The following code in FW3.5 not working in Client Data Service

if (ctx != null && ctx.UsersContext != null)
{
    string username = "username";
    var userList = ctx.UsersContext.Where(z => z.Code ==                      username).AsEnumerable().ToList();
}

I even tried Windows Application purpose to see that the SP does not hurt me



The Error Massage was:

An error occurred while processing this request

"<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?><error xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\"><code></code><message xml:lang=\"en-US\">The MaxDataServiceVersion '1.0' is too low for the response. The lowest supported version is '2.0'.</message></error>"






I'll not go with you all the way I went through hardships

The problem is development server and production server does not always match (which always advisable to have :)).
One Development server was windows Server 2008 R2 which was the error. And another was a windows server 2008 R2 SP1

Of course I did not notice until the solution - I only need to install Windows 2008 r2 SP1

Soon I will try to give you a few more problems cropped up this complex project,
Roi