4

I have SharePoint 2010 installed on a Windows Server 2008 R2 machine which is also hosting SQL Sever 2008 R2. I am attempting to deploy a solution that includes web parts in the 2010 environment that is working fine in MOSS 2007.

The Web Part feature has a feature receiver that updates the web.config. When I try to activate the feature through the Site Collection Feature GUI, I receive an access denied message. I am logged on to the server and in SharePoint with the APP Pool account which is also a member of the domain administrator group, local administrator group and SharePoint Farm Admin group. This account is also dbo on SQL Server.

This same feature activates fine using the stsadm command.

I have dug into this issue at length and here is what I have found:

Looking at the Microsoft assemblies in reflector, my error is coming from the SPWebApplication.ApplyWebConfigModifications() method. I can see the trace statements from SPWebConfigFileChanges.RemoveModificationsWebConfigXMLDocument and SPWebConfigFileChanges.ApplyModificationsWebConfigXMLDocument. The next line is a Save(str).

Below is the output from the SharePoint logs that pertain to this error:

Apply web config modifications to web app
5a817a37-7bf6-4d26-be51-207369e38f5b

02/24/2010 16:05:41.09 w3wp.exe (0x0F64)
0x1034 SharePoint Foundation
General 8grn Medium WebConfigModification: Applying web config modifications to web app in server tw-s1-m4400-007
5a817a37-7bf6-4d26-be51-207369e38f5b

02/24/2010 16:05:41.09 w3wp.exe (0x0F64)
0x1034 SharePoint Foundation
Topology 88gw Medium WebConfigModification: Applying web config modifications to file C:\inetpub\wwwroot\wss\VirtualDirectories\2008\web.config 5a817a37-7bf6-4d26-be51-207369e38f5b

02/24/2010 16:05:41.09 w3wp.exe (0x0F64)
0x1034 SharePoint Foundation
Topology 887b Medium Removing web config node - Path configuration/system.web/httpModules Node name add[@name='JivePageController']
5a817a37-7bf6-4d26-be51-207369e38f5b

02/24/2010 16:05:41.09 w3wp.exe (0x0F64)
0x1034 SharePoint Foundation
Topology 887b Medium Removing web config node - Path configuration/system.web/httpHandlers Node name add[@path='ScriptResource.axd']
5a817a37-7bf6-4d26-be51-207369e38f5b

02/24/2010 16:05:41.09 w3wp.exe (0x0F64)
0x1034 SharePoint Foundation
Topology 887b Medium Removing web config node - Path configuration/runtime/*[local-name()="assemblyBinding" and namespace-uri()="urn:schemas-microsoft-com:asm.v1"] Node name [local-name()="dependentAssembly"][/@name="System.Web.Extensions.Design"] 5a817a37-7bf6-4d26-be51-207369e38f5b

02/24/2010 16:05:41.09 w3wp.exe (0x0F64)
0x1034 SharePoint Foundation
Topology 887b Medium Removing web config node - Path configuration/runtime/*[local-name()="assemblyBinding" and namespace-uri()="urn:schemas-microsoft-com:asm.v1"] Node name [local-name()="dependentAssembly"][/@name="System.Web.Extensions"] 5a817a37-7bf6-4d26-be51-207369e38f5b

02/24/2010 16:05:41.09 w3wp.exe (0x0F64)
0x1034 SharePoint Foundation
Topology 8gp8 Medium WebConfigModification: Adding web config node - Path - configuration/runtime/*[local-name()="assemblyBinding" and namespace-uri()="urn:schemas-microsoft-com:asm.v1"] Node name - [local-name()="dependentAssembly"][/@name="System.Web.Extensions"] Node value - in web.config file C:\inetpub\wwwroot\wss\VirtualDirectories\2008\web.config 5a817a37-7bf6-4d26-be51-207369e38f5b

02/24/2010 16:05:41.09 w3wp.exe (0x0F64)
0x1034 SharePoint Foundation
Topology 8gp8 Medium WebConfigModification: Adding web config node - Path - configuration/runtime/*[local-name()="assemblyBinding" and namespace-uri()="urn:schemas-microsoft-com:asm.v1"] Node name - [local-name()="dependentAssembly"][/@name="System.Web.Extensions.Design"] Node value - in web.config file C:\inetpub\wwwroot\wss\VirtualDirectories\2008\web.config 5a817a37-7bf6-4d26-be51-207369e38f5b

02/24/2010 16:05:41.09 w3wp.exe (0x0F64)
0x1034 SharePoint Foundation
Topology 8gp8 Medium WebConfigModification: Adding web config node - Path - configuration/system.web/httpHandlers Node name - add[@path='ScriptResource.axd'] Node value - in web.config file C:\inetpub\wwwroot\wss\VirtualDirectories\2008\web.config 5a817a37-7bf6-4d26-be51-207369e38f5b

02/24/2010 16:05:41.09 w3wp.exe (0x0F64)
0x1034 SharePoint Foundation
Topology 8gp8 Medium WebConfigModification: Adding web config node - Path - configuration/system.web/httpModules Node name - add[@name='JivePageController'] Node value - in web.config file C:\inetpub\wwwroot\wss\VirtualDirectories\2008\web.config 5a817a37-7bf6-4d26-be51-207369e38f5b

02/24/2010 16:05:41.09 w3wp.exe (0x15C4)
0x1444 SharePoint Foundation
Topology e5mb Medium WcfReceiveRequest: LocalAddress: 'http://tw-s1-m4400-007.jivedemo.local:32843/15702467ece1408f881abeabac3b5077/MetadataWebService.svc' Channel: 'System.ServiceModel.Channels.ServiceChannel' Action: xxx MessageId: 'urn:uuid:4e859532-ed7f-4937-8b88-68d3af43d589' 9f403ede-2c94-490b-a05c-e169cc5fe58d

02/24/2010 16:05:41.10 w3wp.exe (0x0F64)
0x1034 SharePoint Foundation
Topology f6kh High WebConfigModification: Save of web.config file C:\inetpub\wwwroot\wss\VirtualDirectories\2008\web.config for applying modifications to web app SharePoint - 2008 failed. Error message - Access to the path 'C:\inetpub\wwwroot\wss\VirtualDirectories\2008\web.config' is denied.
5a817a37-7bf6-4d26-be51-207369e38f5b

02/24/2010 16:05:41.10 w3wp.exe (0x0F64)
0x1034 SharePoint Foundation
Topology 8j2o High WebConfigModification: Changes not applied to web application SharePoint - 2008 with Url xxx
5a817a37-7bf6-4d26-be51-207369e38f5b

Any help would be appreciated!

4

5 回答 5

3

检查 UAC(用户帐户控制)是否打开,如果这是测试/演示环境,请将其关闭。另一个选项(也是生产环境的最佳选项)是右键单击中央管理链接并选择“以管理员身份运行”选项。

我被这个烧了一会儿,原因是在解决方案部署作业运行之前执行安全检查的方式。如果您在启用 UAC 的情况下运行,则此检查将始终失败(有关 system.security.principal.windowsprincipal,请参阅 MSDN 上的备注部分)。

于 2010-04-28T01:58:30.313 回答
1

确保您的应用程序池的身份对包含 web.config 的目录具有读/写访问权限。

还要确保您的 SharePoint 计时器作业的标识对包含 web.config 文件的目录具有读/写访问权限。

于 2010-02-25T20:42:26.393 回答
0

C:\inetpub\wwwroot\wss\VirtualDirectories\2008\web.config for applying modifications to web app SharePoint - 2008 failed. Error message - Access to the path 'C:\inetpub\wwwroot\wss\VirtualDirectories\2008\web.config' is denied.

Check this file permissions and adjust them appropriately.

于 2010-02-26T06:51:58.427 回答
0

尝试将功能的范围更改为 WebApplication 并从 Central Admin 中激活它

于 2010-02-25T19:38:16.770 回答
0

我们的解决方案是重新组织我们的功能架构,以便我们现在除了 2 个农场范围的功能和 2 个网站集范围的功能之外,还拥有一个 Web 应用程序范围的功能。我们将处理 WebConfigModifications 的代码从我们的网站集范围功能移到了我们新的 Web 应用程序范围功能。

这是它应该一直这样做的方式(以及我们最初尝试这样做的方式),但是 SharePoint 解决方案安装程序不支持我们的功能体系结构,所以我们通过一些代码尝试处理它来解决它在网站集级别使用 WebConfigModifications。这有一些粗略的副作用,例如要求激活网站集功能的帐户也是农场管理员 - 我们必须有一些智能代码才能多次应用或删除我们的设置。

因此,我们必须为此更新 SharePoint 解决方案安装程序 - 并让它在 SharePoint 2010 中工作。它尚未发布,但请观看http://sharepointinstaller.codeplex.com/以了解支持这两种 SharePoint 方案的版本2007 和 SharePoint 2010。

于 2010-06-28T20:05:53.013 回答