我正在使用Nginx + FastCGI-Mono-Server来托管一个小型的asp.net web服务。它在使用FastCGI-Mono-Server2 ( .Net 2.0版本)时运行得很好。我现在需要将asp.net应用程序升级到.net 4.0。这意味着我需要升级到FastCGI-Mono-Server4。我把所有正确的文件都放好了。它起作用了!然而,它总是因为一个神秘的错误而崩溃。
下面是错误:
例外: System.Runtime.FatalException
消息:对象引用未设置为对象的实例。
在System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc&远程过程调用)在System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc&远程过程调用)在System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage3(MessageRpc&远程过程调用)在System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage2(MessageRpc&远程过程调用)在System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc&远程过程调用)在System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage1(MessageRpc&远程过程调用)在System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean StackTrace)在System.ServiceModel.Dispatcher.ChannelHandler.DispatchAndReleasePump(RequestContext请求中,Boolean cleanThread,OperationContext currentOperationContext)在System.ServiceModel.Dispatcher.ChannelHandler.HandleRequest(RequestContext请求时,在System.ServiceModel.Dispatcher.ChannelHandler.AsyncMessagePump(IAsyncResult result)在System.ServiceModel.Dispatcher.ChannelHandler.OnAsyncReceiveComplete(IAsyncResult result)在System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)在System.ServiceModel.Channels.FramingDuplexSessionChannel.TryReceiveAsyncResult.OnReceive(IAsyncResult result)在System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)在System.Runtime.AsyncResult.Complete( OperationContext completedSynchronously)在System.ServiceModel)在Boolean result)在System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)在Boolean result)在System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)在Boolean result)在System.ServiceModel)在Boolean result)在System.ServiceModel)在Boolean completedSynchronously)在System.ServiceModel。Channels.SynchronizedMessageSource.ReceiveAsyncResult.OnReceiveComplete(Object状态)在System.ServiceModel.Channels.SessionConnectionReader.OnAsyncReadComplete(Object状态)在System.ServiceModel.Channels.SocketConnection.AsyncReadCallback(Boolean haveResult的System.ServiceModel.Channels.SocketConnection.FinishRead(),System.ServiceModel.Channels.OverlappedContext.CompleteCallback(UInt32 error,Int32 bytesRead) at System.ServiceModel.Channels.OverlappedContext.CompleteCallback(UInt32 error,bytesRead numBytes,NativeOverlapped* nativeOverlapped) at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 error,UInt32 bytesRead,NativeOverlapped* nativeOverlapped) at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode,UInt32 numBytes,NativeOverlapped* pOVERLAP)
InnerException: System.NullReferenceException
消息:对象引用未设置为对象的实例。
状态:在System.Web.HttpApplication.ThreadContext.Enter(Boolean回调)在System.Web.HttpApplication.OnThreadEnterPrivate(Boolean状态)在System.Web.AspNetSynchronizationContext.CallCallbackPossiblyUnderLock(SendOrPostCallback回调,对象状态)在System.Web.AspNetSynchronizationContext.CallCallback(SendOrPostCallback回调,对象状态)在System.Web.AspNetSynchronizationContext.Post(SendOrPostCallback回调,对象状态)在System.ServiceModel.Dispatcher.ThreadBehavior.BindCore(MessageRpc& rpc,Boolean startOperation)在System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc& rpc)
我在这个项目中确实有一个IHttpAsyncHandler。我想知道这是否与此有关。当我搜索我的错误时,我发现有人(像这样:wcf callback exception after updating to .net 4.0)推荐这个属性:
CallbackBehavior(UseSynchronizationContext=false)
据我所知,这是一个WCF的事情,与我的asp.net网络服务器无关。任何想法都将不胜感激!
EV
发布于 2013-12-11 16:37:14
跑
ln -s /opt/mono-3.2/lib/mono/4.0/fastcgi-mono-server4.exe /opt/mono-3.2/lib/mono/4.5/fastcgi-mono-server4.exe和
使用4.5目录中的fastcgi服务器
/opt/mono-3.2/lib/mono/4.5/fastcgi-mono-server4.exe如果单声道安装在其他地方,请用您的单声道前缀替换/opt/mono-3.2
https://stackoverflow.com/questions/10610423
复制相似问题