Search code examples
c#wcfwindows-8windows-store-appswcf-data-services

Windows 8 Store App, Can't Use WCF Data Service


I create a Windows 8 Store App and try to link to my WCF Data Service here is the code:

Uri uri = new Uri("http://10.0.1.16:8080/CloudEDUServer/CourseService.svc");
CourseService.CloudEDUEntities ctx = new CourseService.CloudEDUEntities(uri);
try
{
    var result = from crs in ctx.COURSE_OK
                 where crs.TITLE == "Test Title3"
                 select crs;
    var result1 = result.FirstOrDefault();   //HERE COMES THE BUG!!!!
    System.Diagnostics.Debug.WriteLine("{0}", result1.TITLE);

}
catch (Exception ex)
{

}

and when it goes in the line where i mark a comment "HERE COMES THE BUG", the program throws an exception, here is the log:

A first chance exception of type 'System.NotSupportedException' occurred in Microsoft.Data.Services.Client.WindowsStore.DLL

I've downloaded the WCF Data Service Tools for Windows 8 Store App and also, when I write a common command line app with the same code, it works well.
What should I do?Can anyone tell me how to fix this bug?


Solution

  • Large God Ren. Windows store app only supports async WCF Data Service. You can get answer here.