我正在使用 Nginx + FastCGI-Mono-Server 来托管一个小型的 asp.net Web 服务。使用 FastCGI-Mono-Server2(即 .Net 2.0 版本)运行良好。我现在需要将 asp.net 应用程序升级到 .net 4.0。这意味着我需要升级到 FastCGI-Mono-Server4。我把所有正确的文件都放好了。有用!但是,它总是因一个神秘的错误而崩溃。
这是错误:
异常:System.Runtime.FatalException
消息:对象引用未设置为对象的实例。
StackTrace:在 System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc& rpc) 在 System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc) 在 System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage3(MessageRpc& rpc) 在 System.ServiceModel.Dispatcher .ImmutableDispatchRuntime.ProcessMessage2(MessageRpc& rpc) 在 System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc& rpc) 在 System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage1(MessageRpc& rpc) 在 System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)在 System.ServiceModel.Dispatcher.ChannelHandler.DispatchAndReleasePump(RequestContext 请求,布尔型 cleanThread,OperationContext currentOperationContext) 在 System.ServiceModel.Dispatcher.ChannelHandler.OnAsyncReceiveComplete(IAsyncResult result) 在 System.ServiceModel.Dispatcher.ChannelHandler.AsyncMessagePump(IAsyncResult result) 在 System.ServiceModel.Dispatcher.ChannelHandler.HandleRequest(RequestContext request, OperationContext currentOperationContext) 在 System .Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult 结果) 在 System.Runtime.AsyncResult.Complete(Boolean completedSynchronously) 在 System.ServiceModel.Channels.FramingDuplexSessionChannel.TryReceiveAsyncResult.OnReceive(IAsyncResult 结果) 在 System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame (IAsyncResult 结果)在 System.ServiceModel.Channels.SynchronizedMessageSource 的 System.Runtime.AsyncResult.Complete(Boolean completedSynchronously)。System.ServiceModel.Channels.SocketConnection.FinishRead() 的 System.ServiceModel.Channels.SessionConnectionReader.OnAsyncReadComplete(Object state) 的 System.ServiceModel.Channels.SocketConnection.AsyncReadCallback 的 ReceiveAsyncResult.OnReceiveComplete(Object state) (Boolean haveResult, Int32 错误, Int32 bytesRead)在 System.ServiceModel.Channels.OverlappedContext.CompleteCallback(UInt32 错误,UInt32 numBytes,NativeOverlapped* nativeOverlapped)在 System.Runtime.Fx.IOCompletionThunk.UnhandledExceptionFrame(UInt32 错误,UInt32 bytesRead,NativeOverlapped* nativeOverlapped)在 System.Threading。 _IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)OnAsyncReadComplete(Object state) at System.ServiceModel.Channels.SocketConnection.FinishRead() at System.ServiceModel.Channels.SocketConnection.AsyncReadCallback(Boolean haveResult, Int32 error, Int32 bytesRead) at System.ServiceModel.Channels.OverlappedContext.CompleteCallback(UInt32 error , UInt32 numBytes, NativeOverlapped* nativeOverlapped) 在 System.Runtime.Fx.IOCompletionThunk.UnhandledExceptionFrame(UInt32 错误, UInt32 bytesRead, NativeOverlapped* nativeOverlapped) 在 System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)OnAsyncReadComplete(Object state) at System.ServiceModel.Channels.SocketConnection.FinishRead() at System.ServiceModel.Channels.SocketConnection.AsyncReadCallback(Boolean haveResult, Int32 error, Int32 bytesRead) at System.ServiceModel.Channels.OverlappedContext.CompleteCallback(UInt32 error , UInt32 numBytes, NativeOverlapped* nativeOverlapped) 在 System.Runtime.Fx.IOCompletionThunk.UnhandledExceptionFrame(UInt32 错误, UInt32 bytesRead, NativeOverlapped* nativeOverlapped) 在 System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)OverlappedContext.CompleteCallback(UInt32 error, UInt32 numBytes, NativeOverlapped* nativeOverlapped) at System.Runtime.Fx.IOCompletionThunk.UnhandledExceptionFrame(UInt32 error, UInt32 bytesRead, NativeOverlapped* nativeOverlapped) at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes,本机重叠* pOVERLAP)OverlappedContext.CompleteCallback(UInt32 error, UInt32 numBytes, NativeOverlapped* nativeOverlapped) at System.Runtime.Fx.IOCompletionThunk.UnhandledExceptionFrame(UInt32 error, UInt32 bytesRead, NativeOverlapped* nativeOverlapped) at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes,本机重叠* pOVERLAP)
内部异常:System.NullReferenceException
消息:对象引用未设置为对象的实例。
StackTrace:在 System.Web.HttpApplication.OnThreadEnterPrivate(Boolean setImpersonationContext) 在 System.Web.HttpApplication.ThreadContext.Enter(Boolean setImpersonationContext) 在 System.Web.AspNetSynchronizationContext.CallCallbackPossiblyUnderLock(SendOrPostCallback 回调,对象状态) 在 System.Web.AspNetSynchronizationContext。 CallCallback(SendOrPostCallback callback, Object state) at System.Web.AspNetSynchronizationContext.Post(SendOrPostCallback callback, Object state) at System.ServiceModel.Dispatcher.ThreadBehavior.BindCore(MessageRpc& rpc, Boolean startOperation) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4 (MessageRpc&rpc)
我在项目中有一个 IHttpAsyncHandler 。我想知道它是否与此有关。当我搜索我的错误时,我发现有人(例如:更新到 .net 4.0 后的 wcf 回调异常)推荐此属性:
[回调行为(UseSynchronizationContext=false)]
据我所知,这是 WCF 的事情,与我的 asp.net Web 服务器无关。任何想法,将不胜感激!
电动汽车