Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The server encountered an error processing the request. See server logs for more details

I have a simple problem.

I've created a WCF Data Service 5.6 in visual studio 2013, and in its *.svc.cs file, modified line

public class CustomdataService : DataService< /* TODO: put your data source class name here */ >

to connect my entities

public class CustomdataService : DataService< SchedulerEntities >

But when I want to see the service in browser it gives me following error

Request Error

The server encountered an error processing the request. See server logs for more details.

The entity framework is nothing but a single table...

like image 708
Kourosh Avatar asked Feb 15 '14 20:02

Kourosh


2 Answers

The actual error can be different. In my case I got the same general error message when starting with AdventureWorks2012 database.

So the actual problem can be seen by appending an attribute to the service class as described at here:

[ServiceBehavior(IncludeExceptionDetailInFaults = true)]
public class WcfDataServiceAW : EntityFrameworkDataService<AdventureWorks2012Entities> { ... }

Hope it helps someone.

PS. My error is:

The exception message is 'The property 'SpatialLocation' on type 'Address' is of type 'Geography' which is not a supported primitive type.'.

like image 187
Artyom Avatar answered Oct 19 '22 13:10

Artyom


It seems that Entity Framework 6 and WCF Data Services 5.6.0 need some provider to work together, read more on Using WCF Data Services 5.6.0 with Entity Framework 6+.

You can download the provider simply by using NuGet Package Console Manager:

Install-Package Microsoft.OData.EntityFrameworkProvider -Pre

Its version is alpha 2, so in future, search for final release. it worked for me however.

Final thing is, instead of using DataService<T>, you need to use EntityFrameworkDataService<T>. T is the name of your entities.

like image 23
Kourosh Avatar answered Oct 19 '22 12:10

Kourosh