これは、既存のサイトコレクションとその下の新しいサイト、およびそれらのサブサイトで機能しますが、新しいサイトコレクションを作成すると、ルートサイトとしてファイルが見つからないというエラーが発生するため、新しいサイトコレクションを作成することもできません。新しいサイトコレクションがマスターページを見つけることができません...なぜですか?どういう意味?
using (SPWeb currentWeb = (SPWeb)properties.Feature.Parent)
{
using (SPSite currentSite = currentWeb.Site)
{
//Set Masterpage
Uri masterURI = new Uri(currentSite.Url + "/_catalogs/masterpage/V4Copy.master");
currentWeb.CustomMasterUrl = masterURI.AbsolutePath;
currentWeb.MasterUrl = masterURI.AbsolutePath;
currentWeb.Update();
}
}