2013-07-16 4 views
5

私はFluentSecurityを使用してASP.NET MVC Webサイトを持っています。 Azureウェブサイトとしてはうまく動作します。私はそれをWebRoleにする必要があります。私はWebRoleプロジェクトを追加しましたが、WebRoleは起動時に "内部サーバーエラーが発生したためページを表示できません。FluentSecurityはAzure WebRoleを失敗させます

私はhttp://blog.mariusschulz.com/setting-up-fluentsecurity-to-use-ninject-for-dependency-resolutionに応じIPolicyViolationHandler全体FluentSecurityのセットアップを実施しDenyAnonymousAccessPolicyViolationHandlerRequireRolePolicyViolationHandlerを持っています。

IPolicyViolationHandlerを実装する両方のクラスを削除すると、WebRoleが正常に起動することがわかりました。この問題を示すサンプルプロジェクトを作成しました。https://dl.dropboxusercontent.com/u/73642/MvcApplication1.zipにあります。

私はどのようにして私のポリシークラスを含むAzure WebRoleでFluentSecurityを利用できますか?

+1

ようにあなたは今まで、この解決策を見つけますか?私はDenyAnonymousAccessPolicyViolationHandlerで全く同じ問題を抱えています。 – Faraday

+0

私はしませんでした。私はGithubのバグを報告しましたが、私は応答がありません –

答えて

0

同じ問題がありました。ウェブサイトでは動作しますが、Webロールでは動作しません。

Fluent SecurityがMVC3ではなくMVC4を参照していたからです。 Githubのこのバグへのコメントは、詳細https://github.com/kristofferahl/FluentSecurity/pull/39に行きます。

あなたがいずれかを実行できます。

1)FluentSecurity.csprojのローカルコピーを取ると、それはMVC 4にSystem.Web.MVC参照ですアップグレードし、その後、(これは私たちが何をしたかである)あなたの溶液中に含まれています。

2)また、上記のGithubのバグリンクあたりとして「...組み立てあなたのweb.configファイルにリダイレクト使用してこの問題を修正」この

<runtime> 
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> 
    <dependentAssembly> 
    <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" /> 
    <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" /> 
    </dependentAssembly> 
    <dependentAssembly> 
    <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" /> 
    <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" /> 
    </dependentAssembly> 
    <dependentAssembly> 
    <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" /> 
    <bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" /> 
    </dependentAssembly> 
</runtime> 
関連する問題