问题
I'm trying to run ASP.NET MVC 2 web site under the Windows Azure Dev Fabric using the DotNetOpenAuth OpenID authentication.
Azure Dev fabric itself repeatedly crashes (dfloadbalancer.exe), when I authenticate.
Are there any workarounds for the issue that allow to use Azure Dev fabric and DotNetOpenAuth?
MSDN seems to have some old discussion on the same issue which has been abandoned.
System.Net.Sockets.SocketException was unhandled
Message=An existing connection was forcibly closed by the remote host
Source=System
ErrorCode=10054
NativeErrorCode=10054
StackTrace:
at System.Net.Sockets.Socket.Shutdown(SocketShutdown how)
at Microsoft.ServiceHosting.Tools.DevelopmentFabric.LoadBalancer.ConnectionInfo.Release()
at Microsoft.ServiceHosting.Tools.DevelopmentFabric.LoadBalancer.ServerConnector.Stop()
at Microsoft.ServiceHosting.Tools.DevelopmentFabric.LoadBalancer.PacketForwarder.ProcessReceive(IAsyncResult result)
at System.Net.LazyAsyncResult.Complete(IntPtr userToken)
at System.Threading.ExecutionContext.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Net.ContextAwareResult.Complete(IntPtr userToken)
at System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr userToken)
at System.Net.Sockets.BaseOverlappedAsyncResult.CompletionPortCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)
InnerException:
Latest log messages before crashing are:
[WaWebHost.exe] Redirecting to http://www.myopenid.com/server?openid.claimed_id=http%3A%2F%2Fxxxxxx.myopenid.com%2F&openid.identity=http%3A%2F%2Fxxxxxx.myopenid.com%2F&openid.assoc_handle=xxxxxxx&openid.return_to=http%3A%2F%2F127.0.0.1%2Fuser%2FAuthenticate%3FReturnUrl%3D%26dnoa.userSuppliedIdentifier%3Dhttp%253A%252F%252Fxxxxxxxx.myopenid.com%252F&openid.realm=http%3A%2F%2F127.0.0.1%2F&openid.mode=checkid_setup&openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0
[fabric] Role state Unresponsive
回答1:
I ran across this problem when using this following statement:
return request.RedirectingResponse.AsActionResult();
I corrected this by changing the line to:
string location = request.RedirectingResponse.Headers["Location"];
return Redirect(location);
For reasons unknown to me, this got around the error and allowed me to get back to business without making any special changes to my development environment.
来源:https://stackoverflow.com/questions/2692872/azure-dev-fabric-crashes-with-socketexception-when-using-dotnetopenauth