Search code examples
sharepointuacsolution

How to add a solution in SharePoint when the UAC is Enabled?


I use stsadm-o addsolution -filename "mySolution" to install a solution, but when the UAC(User Account Control) is enabled, a "Access Denied" exception will be thrown. I want to know how to add a solution with UAC enabled?

Note: I cannot use runas administrator, for it's cannot be invoked by third assemblies.

Update: I just want to use C# to implement Runas Administrator.

thanks in advance.


Solution

  • after two days investigating, I have the final result.

    In SharePoint 2010, I installed a solution named "NewsGator.Core.wsp", it's a third party solution. When it's installed, some assemblies will be deployed to GAC. When you retract the solution you must notice that if the assemblies are used by w3wp.exe or not(process monitor can do this, you should first run it as administrator), if so your retract job will failed. It occurs in UAC enabled environment and will succeed if you use runas administrator to execute retract method.

    So, firstly I doubted it as permission issue, using runas administrator can just make it work, then I came to ask the question above, but finally I found the cause by process monitor, after ended w3wp.exe or iisreset I got my retract job complete with successful.

    Hope the above can help you.

    Thanks very much for all your help, best regards.