【发布时间】:2018-01-19 09:09:02
【问题描述】:
我在 SharePoint 中有一项功能,可将 Web 部件添加到所创建的每个新网站的 Web 部件库中。有问题的代码行如下:
string webPartPath = System.Web.Hosting.HostingEnvironment.MapPath("~/" +
CompanyConstants.CustomWebPart);
FileInfo f = new FileInfo(webPartPath);
FileStream s = f.Open(FileMode.Open, FileAccess.Read);
字符串 webPartPath 的计算结果如下:
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\template\layouts\*CENSORED*\*CENSORED*\WebPart\CustomWebpart.dwp
我收到的错误如下:
该进程无法访问文件“C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\template\layouts*CENSORED**CENSORED*\WebPart\CustomWebpart.dwp”,因为它正被另一个进程。
有谁知道为什么会发生这种情况?非常感谢您的帮助。
【问题讨论】:
标签: c# sharepoint