Hallo zusammen,
ich bekomme immer Fehlermeldungen, wenn ich versuche eine Sahrepoint Liste auszulesen.
Fehlermeldung:
System.Net.WebException: "Die zugrunde liegende Verbindung wurde geschlossen: Unerwarteter Fehler beim Senden.."
SocketException: Eine vorhandene Verbindung wurde vom Remotehost geschlossen
using Microsoft.Office.Tools.Ribbon;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Microsoft.SharePoint.Client;
using SP = Microsoft.SharePoint.Client;
using System.Net;
using System.Security;
using Microsoft.SharePoint.Client;
private void checkBox2_Click(object sender, RibbonControlEventArgs e)
{
//ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
string siteURL = "https://kpsoftwaretechnik.sharepoint.com";
// Starting with ClientContext, the constructor requires a URL to the
// server running SharePoint.
ClientContext context = new ClientContext(siteURL);
// The SharePoint web at the URL.
Web web = context.Web;
// Retrieve all lists from the server.
// For each list, retrieve Title and Id.
context.Load(web.Lists,
lists => lists.Include(list => list.Title,
list => list.Id));
// Execute query.
context.ExecuteQuery();
// Enumerate the web.Lists.
foreach (List list in web.Lists)
{
MessageBox.Show(list.Title);
}
}
*****************
Hat jemand eine Lösung?
Beste Grüße
Jürgen
Bitte in Zukunft selbst die richtigen Code Tags setzen. Niemand hat lust unformatierten Code zu lesen.
[Hinweis] Wie poste ich richtig?
Du authentifizierst Dich halt auch nirgends.
Wirst wahrscheinlich dazu Infos in der Inner Exception bekommen.
- performance is a feature -
Microsoft MVP - @Website - @AzureStuttgart - github.com/BenjaminAbt - Sustainable Code