views:

30

answers:

0

Hello people,

I developed a library in VS 2010 that uses classes generated by SPMETAL in order to access information available at a Sharepoint site. This library may get called from two places:

  • A console application (merely for testing purposes, but the problem is here)
  • A webpart inside Sharepoint itself.

Now, whenever I call the library from the webpart, it runs fine and dandy. But if I attempt to call the library, through the service, from the console application, the Data Context class that the library itself has, is never able to connect to the Sharepoint Site.

While debugging the Service, it throws this error at the last line:

alt text

using (var dataContext = new DatasetDataContext("http://webapp/sites/sitecollection/site")) { // Disabled for performance, since I'm just retrieving data dataContext.ObjectTrackingEnabled = false;

           ////Tracks
           var collections = dataContext.GetList<CollectionsItem>("Collections");

Has anyone any idea on why this could be happening, and if there is a way to solve it?

Thank you!!