プログラムでサイトコレクションを作成しようとしています。約6か月間機能しましたが、サーバーが更新された後(さまざまなパッチ)、機能しなくなりました(3つのサーバーがあります:1つの開発、1つのテスト、1つの本番)。更新されていない私の開発環境ではまだ機能していますが、他の2つでは機能していません。エラーメッセージは表示されません。サイトコレクションを追加するはずのコードでハングします(以下のコードを参照)。Windows Server 2003R2とSharepoint2007(バージョン12.0.0.6421)を使用しています。エラーは発生しません。InternetExplorerが「要求がタイムアウトしました」という応答が返されるまでハングします。コードをデバッグしようとすると、コードはそこで停止し、何も起こりません。エラーメッセージなどはありません。
public static string CreateSPAccountSite(string siteName)
{
string url = "";
SPSecurity.RunWithElevatedPrivileges(delegate()
{
SPWeb web = SPContext.Current.Web;
using (SPSite siteCollectionOuter = new SPSite(web.Site.ID))
{
SPWebApplication webApp = siteCollectionOuter.WebApplication;
SPSiteCollection siteCollection = webApp.Sites;
SPSite site = siteCollection.Add("sites/" + siteName, siteName, "Auto generated Site collection.", 1033, "STS#0", siteCollectionOuter.Owner.LoginName, siteCollectionOuter.Owner.Name, siteCollectionOuter.Owner.Email); //Hangs here site.PortalName = "Portal";
site.PortalUrl = mainUrl; // https://www.ourdomain.net
url = site.Url;
}
});
return url; //Should be "https://www.outdomain.net/sites/siteName"
}