在以编程方式在SharePoint Online中创建一个新站点时,我遇到了一个问题。我试着从网络部件上运行它。在前提下,一切都很有魅力,但当我将它部署到SharePoint Online时,它偶尔会产生错误。如果我在收到错误并重试后更改了文本框中的站点名,它将运行良好。
我得到以下例外:
Microsoft.SharePoint.SPException:网站地址“/nederland/blablablablalblasd”已经在使用。-> System.Runtime.InteropServices.COMException: 0x800700b7网站地址“/nederland/blablablablalblasd”已经在使用。在.
webpart必须创建一个站点并为该站点创建一个组。组成员是由词义填充的。我使用的代码是:
using (SPSite currentSite = SPContext.Current.Site)
{
using (SPWeb currentWeb = currentSite.OpenWeb())
{
try
{
SPWeb site = null;
uint lcid = currentWeb.Language;
string templateName = "WIKI#0";
site = currentWeb.Webs.Add(siteName.Text, siteName.Text, siteDesc.Text, lcid, templateName, true, false);
}
catch (Exception exception)
{
DebugUsingLiteral(exception.ToString());
}
}
}希望你能帮我一把。
发布于 2013-06-20 15:39:08
最后,从一个App部件切换到一个应用程序。在我看来,SharePoint,2013年在线和CSOM是一个更好的组合。
它还提供了在SPOnline环境中调试解决方案的能力。
https://stackoverflow.com/questions/16983780
复制相似问题