SharePoint 2010 - Access Denied During ApplyWebConfigModifications ()

I have installed SharePoint 2010 on a computer running Windows Server 2008 R2, which also hosts SQL Sever 2008 R2. I am trying to deploy a solution that includes web parts in a 2010 environment that works fine in MOSS 2007.

A web part function has a function receiver that updates web.config. When I try to activate a feature through the Feature Collection GUI, I get a denied access message. I am registered on the server and in SharePoint with the APP pool account, which is also a member of the domain administrator group, the local administrators group, and the SharePoint Farm administrator group. This account is also a dbo on SQL Server.

The same function is activated using the stsadm command.

I delved into this problem in detail and here is what I found:

If you look at the Microsoft assembly in the reflector, my error comes from the SPWebApplication.ApplyWebConfigModifications () method. I can see the trace instructions from SPWebConfigFileChanges.RemoveModificationsWebConfigXMLDocument and SPWebConfigFileChanges.ApplyModificationsWebConfigXMLDocument. The next line is Save (str).

The following is the result of the SharePoint logs related to this error:

Apply changes to web configuration on the web application
5a817a37-7bf6-4d26-be51-207369e38f5b

02/24/2010 16: 05: 41.09 w3wp.exe (0x0F64)
0x1034 SharePoint Foundation
General 8UAH Medium WebConfigModification: Applying web configuration changes for a web application on a 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 configuration changes for 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 node web configuration - Track 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 Deleting a web configuration node - Track 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 Deleting a web configuration node - Track / * [Local configuration name / runtime () = "assemblyBinding" and URI-namespace () = "urn: schema-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 Deleting a web configuration node - Track / * [Local configuration name / runtime () = "assemblyBinding" and URI-namespace () = "urn: schema-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 a web configuration node - Path - / * [Local configuration name / runtime () = "assemblyBinding" and also URI-namespace () = "urn: Microsoft-com-schemes: asm.v1" ] node name - [Local name () = "dependentAssembly"] [/ @ name = "System.Web.Extensions"] node value - in the 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 a web configuration node - Path - / * [Local configuration name / runtime () = "assemblyBinding" and also URI-namespace () = "urn: Microsoft-com-schemes: asm.v1" ] node name - [Local name () = "dependentAssembly"] [/ @ name = "System.Web.Extensions.Design"] node value - in the 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 node web configuration - Path - Configuration /system.web/HttpHandlers node name - add [@path = 'ScriptResource.axd'] Nodevalue - in web.config 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
8gp8 Topology Medium WebConfigModification: Adding node web configuration - Path - Configuration /system.web/HttpModules node name - add [@ name = 'JivePageController'] Nodevalue - in web.config 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 Average value WcfReceiveRequest: LocalAddress: ' http: //tw-s1-m4400-007.jivedemo.local: 32843 / 15702467ece1408f881abeabac3b5077 / MetadataWebService.svc ' Source: 'System.ServiceModel.Channels.SerdChxx Message Ballot box: 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 Awesome WebConfigModification: Save the web.config file C: \ Inetpub \ Wwwroot \ WSS \ VirtualDirectories \ 2008 \ web.config for making changes to the web application SharePoint error 2008 - message error - access to 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
8j2o Topology High WebConfigModification: Changes Not Applied to a SharePoint 2008 Web Application Using Url xxx
5a817a37-7bf6-4d26-be51-207369e38f5b

Any help would be appreciated!

+4
source share
5 answers

Check if UAC (User Account Control) is enabled and disable it if it is a test environment . Another option (and the best option for production environments) is to right-click on the central administrator link and select the option โ€œRun as administratorโ€.

I got a little burned out because of this, and the reason is that a security check is performed before the deployment task starts. If you work with enabled UAC, this check will always fail (see the "Notes" section on MSDN for system.security.principal.windowsprincipal).

+3
source

Verify that the identity of the application pool has read / write access to the directory containing the web.config file.

Also, make sure that the identifier for your SharePoint timer job has read / write access to the directory containing the web.config file.

+1
source

Try changing the scope to WebApplication and activating it from Central Administration

0
source

C: \ Inetpub \ Wwwroot \ WSS \ VirtualDirectories \ 2008 \ web.config for making changes to the web application SharePoint Error 2008 - error message - Access to path 'C: \ Inetpub \ Wwwroot \ WSS \ VirtualDirectories \ 2008 \ web. config 'is denied.

Check file permissions and configure them accordingly.

0
source

Our solution was to reorganize our functional architecture so that we now have a scope with web applications in addition to the features covered by two farms and 2 cloud functions. We have migrated our WebConfigModifications code from our functions related to the scope of the website to our new scope with web applications.

It was the way it was supposed to be done all the time (and the way we tried to do it initially some time ago), but the SharePoint solution installer did not support our feature architecture, so we worked around it with a bit of code trying to figure out the WebConfigModifications level site collections. This had some gross side effects, such as requiring an account that activated the site collection feature to also be a farm administrator, and we had to have some smart code to not apply or delete our settings several times.

So, we had to update the SharePoint solution installer for this, and also make it work in SharePoint 2010. It has not yet been released, but see http://sharepointinstaller.codeplex.com/ for releases that support this scenario for both SharePoint 2007 and for SharePoint 2010.

0
source

Source: https://habr.com/ru/post/1302393/


All Articles