Error “Evaluating the function '…SharePoint.PortalPath.get' timed out and needed to be aborted in an unsafe way”

  • Thread starter Thread starter Dennis Nxxxxx
  • Start date Start date
D

Dennis Nxxxxx

Guest
We are having an issue with our software (C# .NET Framework 4) when requesting document information from SharePoint 2010 server.
We are requesting the information this way:


public string GetListItemPropertiesByUrl(string url)
{
try
{
string redUrl = string.Empty;
using (ClientContext clientContext = new ClientContext(PortalPath))
{
clientContext.Credentials = new System.Net.NetworkCredential(System.Configuration.ConfigurationManager.AppSettings["SPUser"], System.Configuration.ConfigurationManager.AppSettings["SPUserPass"]);
redUrl = GetRedirectUrlFromDocIdUrl(url).Replace("http://portal.grolman.de", "").Replace("http://testportal.grolman.de", "");
}
return redUrl;
}
catch (Exception ex)
{
throw ex;
}
}


This works fine if we have only some documents to request. If we request many documents, it works only 3-4 times, then the application hangs up with this error:

> Evaluating the function '...SharePoint.PortalPath.get' timed out and
> needed to be aborted in an unsafe way. This may have corrupted the
> target process.
>
> If the problem happens regularly, consider disabling the
> Tools->Options setting "Debugging->General->Enable property
> evalualtion and other implicit function calls" or change the code to
> disable evaluation of this method. See help for information on doing
> this.

It happens at this line of code


using (ClientContext clientContext = new ClientContext(PortalPath))


I already tried the advise in the error message and searched a lot on the internet, but all solutions did not solve this issue. This error still happens.
I.e. we enabled the option "User Managed Compatibility Mode" and "Use the legacy C# and VB expression evaluators".
We are using Visual Studio 2017 15.9.11.
I already saw this post on Stackoverflow, but this did not help either.

Evaluating the function 'function' timed out

Are there any hints or tipps, how we can try to solve this issue?

Continue reading...
 
Back
Top