Я пытаюсь создать сайт Sharepoint с использованием клиентских пространств имен Sharepoint, полный код приведен ниже
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Client;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
SPSite topLevelSite = new SPSite("http://localhost");
SPWeb spWebInstance = topLevelSite.OpenWeb();
String siteTemplate = spWebInstance.WebTemplate;
try
{
SharePointWebInstance.Webs.Add("the name", "name", "new site added", (UInt32)System.Globalization.CultureInfo.CurrentCulture.LCID, siteTemplate, false, false);
}
catch (Exception ex)
{
//...
}
finally
{
topLevelSite.Close();
SharePointWebInstance.Dispose();
}
}
}
}
И я получаю ошибку C # на SharePointWebInstance.Webs.Add. Есть мысли?