私はSoftsys Hostingについて良いことを聞いたので、私は自分のASP.NET MVCソリューションをそれらに移すことに決めました。しかし、それはそれらに実行されません。 BeginRequestイベントハンドラに問題を突き止めることができました。もし私がそれらを持っていたら、私はエラーを起こすだろう。ここに私のコードです。私のホスト(softsyshosting.com)がBeginRequestおよびEndRequestイベントハンドラをサポートしないのはなぜですか?
protected void Application_Start()
{
RegisterRoutes(RouteTable.Routes);
this.BeginRequest += new EventHandler(MvcApplication_BeginRequest);
this.EndRequest += new EventHandler(MvcApplication_EndRequest);
}
void MvcApplication_EndRequest(object sender, EventArgs e)
{
}
void MvcApplication_BeginRequest(object sender, EventArgs e)
{
}
デフォルトのASP.NET MVCアプリケーションを作成し、上記のコードを追加するだけで問題を再現できます。奇妙なことは、このコードは私の古いホストで正常に動作し、新しい(共有)ホストでのみクラッシュすることです。私は私のコードでこれらのイベントハンドラを持っている場合、私はこのエラーを取得する:
Server Error in '/' Application. Object reference not set to an instance of an object. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.] System.Web.PipelineModuleStepContainer.GetStepArray(RequestNotification notification, Boolean isPostEvent) +27 System.Web.PipelineModuleStepContainer.GetEventCount(RequestNotification notification, Boolean isPostEvent) +11 System.Web.PipelineStepManager.ResumeSteps(Exception error) +205 System.Web.HttpApplication.BeginProcessRequestNotification(HttpContext context, AsyncCallback cb) +91 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +514
私はSoftsysと、このトラブルシューティングを試してみましたが、彼らは非常に有用ではなかった、基本的に彼らはちょうど私が「ASP.NETパイプラインになっていたことを確認しました(MVC)」機能を使用することができます。
誰かができます:私は
- が教えてはくれ
- このエラーがあるホスト上でoccuringや他のされていない理由を私に説明回避策を表示します。
ことではなく、あなたのホスティング事業者の支援のための問題ではないでしょうか? –
万が一NHibernateを使用していますか? –
Oliver、はい私はSoftsys Hostingからのサポートを得ようとしましたが、あまり役に立ちませんでした。彼らはこれを解決するために私に$ 95/HRを請求したかった。私は彼らのことについて他には満足していたし、もし私が間違っているとしたら、それらをあきらめたくない。 Dreas、いいえNHibernateを使用していません。 – Whozumommy