質問

サンプルSharePointプロジェクトでテストをするときにかなり大きな間違いをしたように見えます。皮肉なことに、私は最初にテストの多くを書かずに単体のテスト可能な解決策を上げようとしていました。私はまだSharePointにとってほとんど新しいもので、SPとIOCでできないものを探求したいと思いました。

それほど細かく入ることなく、私は誤って再帰的なコードを書いて、StackOverFlowExceptionを投げると終了します。大したことではありませんね。解決策を撤回して削除してください。この問題は、このコードがFeatureUninstallingのソリューション機能のSPFeatureReceiverメソッド中に呼び出されることです。

(正確には正確にはありません。このコードは、SPFeatureReceiverの静的コンストラクターの間に呼び出されます。なぜ疑問に思っています。そして、機能の中止方法)

では、中央のWeb管理者またはUninstall-SPSolutionのいずれかを使用しようとするとどうなります。

  1. ジョブは解を撤回するようにスケジュールされます。
  2. ジョブは解決策を実行し、解体しようとします。
  3. FeationUninstallingを呼び出すために、ジョブは新しいSPFeatureceiverを構築します。
  4. spfeatureceiver(static)コンストラクターは、ルートを作成しようとするコードを呼び出し、そこではStackOverFlowExceptionをスローして終了します。
  5. 私は、owstimer.exeが例外を検出し、デバッグしたいかどうかを尋ねることを示すポップアップメッセージを受け取ります。
  6. owStimer.exeはステップ#2に再起動してループバックします。

    それゆえ質問:未還元的な解決策をどのように引き込むか?

役に立ちましたか?

解決

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.

他のヒント

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.

ライセンス: CC-BY-SA帰属
所属していません sharepoint.stackexchange
scroll top