0

我将在事件接收器项目 SharePoint 2016 中修改 web.config。我在 FeatureActivated 函数中使用这段代码来访问 web.config 以对其进行修改:

SPWeb myWeb = properties.Feature.Parent as SPWeb;
            SPWebApplication spWebApplication = myWeb.Site.WebApplication;
            Collection<SPWebConfigModification> webConfigCollection = spWebApplication.WebConfigModifications;
            int modCollectioncount = webConfigCollection.Count;

但是这段代码`webConfigCollection.Count 返回零。我的方式有什么问题?

4

0 回答 0