我发布了第一个出现here的问题,因为它似乎在微软论坛上已经死了。另外,Stack Overflow更好。 :-P
我正在Azure上以辅助角色托管TCP端点 -
var _breadcrumbServiceHost = new ServiceHost(typeof(BreadcrumbService));
var binding = new NetTcpBinding(SecurityMode.None);
var externalEndPoint = RoleEnvironment.CurrentRoleInstance.InstanceEndpoints["shuttles"];
_breadcrumbServiceHost.AddServiceEndpoint(typeof(IBreadcrumbService), binding, String.Format("net.tcp://{0}/BreadcrumbService", externalEndPoint.IPEndpoint));
我得到两个抛出异常 -
System.InvalidProgramException - Common Language Runtime detected an invalid program
和
Unhandled exception: System.Runtime.CallbackException: Async Callback threw an exception. ---> System.InvalidProgramException: Common Language Runtime detected an invalid program.
at System.ServiceModel.Dispatcher.ErrorBehavior.HandleErrorCommon(Exception error, ErrorHandlerFaultInfo& faultInfo)
at System.ServiceModel.Dispatcher.ChannelDispatcher.HandleError(Exception error, ErrorHandlerFaultInfo& faultInfo)
at System.ServiceModel.Dispatcher.ChannelDispatcher.HandleError(Exception error)
at System.ServiceModel.Dispatcher.ErrorHandlingReceiver.EndTryReceive(IAsyncResult result, RequestContext& requestContext)
at System.ServiceModel.Dispatcher.ChannelHandler.EndTryReceive(IAsyncResult result, RequestContext& requestContext)
at System.ServiceModel.Dispatcher.ChannelHandler.AsyncMessagePump(IAsyncResult result)
at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)
at System.Runtime.AsyncResult.Complete(Boolean completedSynchronously)
它并不总是发生 - 有时Azure非常高兴。
帮助!!感谢。
答案 0 :(得分:1)
解决了!在工作者和IntelliTrace中托管的WCF似乎存在问题。禁用IntelliTrace解决了它。