Pregunta

Parece que cometí un gran error al hacer algunas pruebas con un proyecto de Sample SharePoint. Irónicamente, estaba tratando de aumentar una solución testible en la unidad, sin escribir primero muchas de las pruebas. Todavía soy bastante nuevo para SharePoint, y quería explorar lo que puedo / no puedo hacer con SP e IOC.

Entonces, sin entrar demasiado detalles, accidentalmente escribí un código que es recursivo y termina lanzar una excepción de StackOverflowException. No es un gran problema, ¿verdad? Simplemente retraiga la solución y retírela. El problema es que este código se llama durante el método GeneracodiCode de una característica de solución en un FeatureUninstalling.

(bueno, no exactamente. El código termina llamándose durante el constructor estático del generador de generación de generación. Si se pregunta por qué, estaba tratando de componer la raíz usando el Windsor del Castillo para inyectar dependencias que se pueden usar durante la característica y caracterice los métodos.)

Entonces, lo que sucede cuando se intenta usar el administrador central central o la desinstalación-spsolution es:

  1. Se programa un trabajo para retraer la solución.
  2. El trabajo ejecuta e intenta retraer la solución.
  3. El trabajo construye un nuevo SPFeaterEcepreiver para invocar con entierro.
  4. El constructor SPFEATORENTECEIVER (estático) invoca el código que intentará componer la raíz, y dentro de allí, termina lanzando una pilaverflowException.
  5. Recibo un mensaje emergente que indica que Owstimer.exe encontró una excepción y pregunta si quiero depurar.
  6. Owstimer.exe Reinicia y se reinicia a Paso # 2.

    De ahí la pregunta: ¿Cómo retraer una solución no retrautable?

¿Fue útil?

Solución

Have you tried commenting out the offending code, rebuilding/repackaging, and then running an Update-SPSolution command?

The FeatureUninstalling event occurs on removal, and, I believe, it will not be called when upgrading (that's what the FeatureUpgrading event is for).

If you can upgrade successfully and replace the offending code, you would then be able to safely remove the solution.

On second thought, my suggestion above wouldn't work, because if this exception is occurring in the constructor, rather than the event, obviously that would still be called regardless of the solution modification method (Upgrade vs. Uninstall). You could manually replace the .dll in the GAC after removing the offending code though, and then trying a retraction.

Otros consejos

I'd had a similar idea to @RJ Cuthbertson's answer regarding the GAC, but it would not let me uninstall anything from there. Until I found this:

IMPORTANT! Never ever do this on a production system, and always turn it back on afterwards.

  1. Open Local Security Policy MMC

  2. Goto Security Settings -> Local Policies -> Security Options

  3. Locate "User Account Control: Run all administrators in Admin Approval" and change the setting from Enabled to Disabled

  4. Reboot and now the assemblies can be deleted.

  5. Follow steps above to re-enable the local security policy setting and reboot again to reapply it.

After step #4 above I was able to remove Castle.Windsor.dll from the GAC, and after that, the retract / uninstall / remove all worked.

Licenciado bajo: CC-BY-SA con atribución
scroll top