Skip to content

Instantly share code, notes, and snippets.

@sandrinodimattia
Created July 22, 2012 02:23
Show Gist options
  • Save sandrinodimattia/3157971 to your computer and use it in GitHub Desktop.
Save sandrinodimattia/3157971 to your computer and use it in GitHub Desktop.
BdcException: The shim execution failed unexpectedly
using (var site = new SPSite("http://localhost"))
{
// Get context for the site.
var context = SPServiceContext.GetContext(site);
// Assign context in SPServiceContext.Current
using (var scope = new SPServiceContextScope(context))
{
...
entity.FindFiltered(...);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment