.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Remoting is hung up in System.Runtime.Remoting.Channels.Http.HttpServerChannel.Listen() and is not a

Posted By:      Posted Date: September 23, 2010    Points: 0   Category :.NET Framework

Hi Everyone,

We have an application that is structured as follows.

WtWindows : a remoting server that runs a exposes 2 singleton objects . We are using HTTP channels

Office Addin : This addin runs in Word , Powerpoint and Excel.

Recently a customer reported that the office and wtwindows had hung and the only way to get out of it was to restart all these applications.

The dumps from the customer show the following

<there is more in the stack trace here which is removed for clarity >

041fee74 037eda18 ParametricTechnology.Windchill.Msoi.WTWindows.ClientConnection.SetActiveDocumentInfo(System.String, System.String, IntPtr)
041ff2b8 79e71b4c [HelperMethodFrame_PROTECTOBJ: 041ff2b8] System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr, System.Object[], System.Object, Int32, Boolean, System.Object[] ByRef)
041ff3fc 79279583 System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(System.RuntimeMethodHandle, System.Object[], System.Object, Int32, Boolean, System.Object[] ByRef)
041ff420 7927039b System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(System.Runtime.Remoting.Messaging.IMessage, Int32, Boolean)
041ff47c 7927024c System.

View Complete Post

More Related Resource Links

the type initializer for 'system.runtime.remoting.identity' threw an exception.

HI, I am trying to implement kerberos delegation in Active Directory enviroment with windows 2003 servers SP2. I have Client, ProxyServer and RemoteServer application that are developed on .Net framework v3.5 using .Net Remoting "System.Runtime.Remoting". I am not using Microsoft.Samples.Security.SSPI &  Microsoft.Samples.Runtime.Remoting.Security directly. my code is based on "http://blogs.msdn.com/dotnetremoting/archive/2006/07/06/662599.aspx" Only change that I have done is put impersonate="true" in channel configuration of ProxyServer and RemoteServer, and of course changed the UPN and Port and IP address. The Client's credentials are successfully impersonated by ProxyServer, I can access the text file on ProxyServer on behalf of client. But when from ProxyServer I try to execute the method on RemoteServer it throws "the type initializer for 'system.runtime.remoting.identity' threw an exception." After looking at blog http://www.secnewsgroups.net/group/microsoft.public.dotnet.security/topic8251.aspx I did required changing under Local Security Settings -> Local Policies -> User Rights Assignments -> impersonate a client after authentication and Create Global Objects. I have added three domain user names in three machine under whose credentials corrosponding application is running. When i run three applications on their

Error warming up the worker process. - Inner Exception: System.Runtime.Remoting.RemotingException: 4

Can anybody guide me how to resolve this,

10/16/2010 01:50:32.39 SPUCHostService.exe (0x0AA4)             0x0D9C SharePoint Foundation         Sandboxed Code Service         fe8d Medium   -  - Error warming up the worker process. - Inner Exception: System.Runtime.Remoting.RemotingException: 4 arguments were passed to 'Microsoft.SharePoint.UserCode.ISPUserCodeWorkerProcessProxy::Initialize'. 3 arguments were expected by this method.    Server stack trace:      at System.Runtime.Remoting.Messaging.Message.CoerceArgs(MethodBase mb, Object[] args, ParameterInfo[] pi)     at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)    Exception rethrown at [0]:      at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)     at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData,

Type 'System.Runtime.Remoting.ServerIdentity' is not marked as serializable.

Hi, I miss a trouble in my current workflow project, and it will cause my workflow instance terminate.  The exception as following. It says ServerIdentity  is not marked as serializable, but ServerIdentity is absolutely serializable.. anyone can help me? thanks a lot.

Code Snippet

Type 'System.Runtime.Remoting.ServerIdentity' in Assembly 'mscorlib, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089' is not marked as serializable. System.Runtime.Serialization.SerializationException: Type 'System.Runtime.Remoting.ServerIdentity' in Assembly 'mscorlib, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089' is not marked as serializable. at System.Runtime.Serialization.FormatterServices.InternalGetSerializableMembers(RuntimeType type) at System.Runtime.Serialization.FormatterServices.GetSerializableMembers(Type type, StreamingContext context) at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitMemberInfo() at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter) at System.Runtime.Serialization.Formatters.Binary.WriteObj

Using IPC only channel getting Unable to cast object of type 'System.Runtime.Remoting.Identity' to


I have a remoting application that is using delegates to preform callbacks between processes. I found that if I don't use a TCP channel at all and only initialize an IPC channel that the callback delegates start throwing the following error after about a minute has passed.

From what little I could find on Google it seems to be a Lifetime Service management issue but all the classes that the delegates belong to return null from InitializeLifetimeService which should give the object an infinite lifetime.

With the TCP channel initialized the issue doesn't happen, but I would like it to use the IPC channel if all of the processes are on the local box.


Type:        System.InvalidCastException
Message:    Unable to cast object of type 'System.Runtime.Remoting.Identity' to type 'System.Runtime.Remoting.ServerIdentity'.
Stack Trace:   
Server stack trace:
   at System.Runtime.Remoting.RemotingServices.GetServerTypeForUri(String URI)
   at System.Runtime.Remoting.Channels.BinaryServerFormatterSink.ProcessMessage(IServerChannelSinkStack sinkStack, IMessage requestMsg, ITransportHeaders requestHeaders, Stream requestStream, IMessage& responseMsg, ITransportHeaders& responseHeaders, Stream& responseStream)


Around the Horn: Engineer a Distributed System Using .NET Remoting for Process Intensive Analysis


Before the Microsoft .NET Framework, creating a distributed cluster of computers to perform scientific analysis was expensive in terms of hardware, programming and debugging time, and maintenance. You had to purchase expensive servers, spend time debugging network communication, design a distributed system completely different from a system deployed locally, and maintain a melting pot of error handling, data acquisition, networking, and analysis code. In this article, the author shows you how he was able to engineer a distributed computing system in C# to perform analysis of real-world data continuously acquired at high sampling rates, thanks to the .NET Framework.

Nate D'Anna

MSDN Magazine May 2005

.NET Remoting: Design and Develop Seamless Distributed Applications for the Common Language Runtime


Prior to the advent of .NET, DCOM was the underlying technology for remote communications between Windows-based applications. But DCOM is quirky to set up and configure and not as interoperable as it should be. In .NET, XML Web Services and .NET Remoting are a seamless and effective answer to the demand for tools to build distributed applications.This article provides a primer on .NET Remoting with insights into the internal plumbing. Important aspects of remoting, such as channels, object lifetime management, and clients for remote objects are discussed. In addition, some practical examples are provided.

Dino Esposito

MSDN Magazine October 2002

NET Runtime version 2.0.50727.3603 - Fatal Execution Engine Error Encountered for Remoting Applicati



We encountered a sudden "NET Runtime version 2.0.50727.3603 - Fatal Execution Engine Error" which caused our application to be terminated. We googled this error, and we found that there was a problem with mscorwks.dll (http://support.microsoft.com/kb/913384). This post is for Dec, 2007, but our servers have latest .NET Service Packs Installed. We feel that since .NET 2.0 SP2 is installed this error might have been fixed by Microsoft in SP2, not sure though. We are looking for any possible solutions, with which we can avoid this error again. I am mentioning the error and .NET software installed on our server below.

The application is installed as a Windows .NET Service and runs under Local System Account.

.NET Softwares Installed.

Microsoft .NET Framework 2.0 Service Pack 2
Microsoft .NET Framework 3.0 Service Pack 2
Microsoft .NET Framework 3.5 SP1
Microsoft Report Viewer Redistributable 2005

Below are the errors logged in the event viewer.

Event Type: Error
Event Source: Service Con

Why is the "System" Process opening and keeping the port open for my .NET remoting framework applica


I'm using Remoting in a .NET 3.5 framework application of mine (running on windows 2008 r2). I'm opening port 8086 with the following code

BinaryServerFormatterSinkProvider serverProv = new BinaryServerFormatterSinkProvider();
      serverProv.TypeFilterLevel = System.Runtime.Serialization.Formatters.TypeFilterLevel.Full;

      BinaryClientFormatterSinkProvider clientProv = new BinaryClientFormatterSinkProvider();
      IDictionary props = new Hashtable();

        props["port"] = 8086
        TcpChannel channel = new TcpChannel(props, clientProv, serverProv);
        ChannelServices.RegisterChannel(channel, false);
          typeof(Remote), "Remote", WellKnownObjectMode.Singleton);
      catch (Exception ex)
        logger.Error("Failed to intialize service remoting: ", ex);

For some reason, when i restart my windows service that has the above code running, it throws an exception saying that "Only one usage of each socket address (protocol/network address/port) is normally permitted". Digging into this a little deaper it turns out that "System" process is holding on to my port and it won't let it go. Even if i kill my process, the "System" process still owns the port.


stop a service using http based .net remoting without terminating a process

I have a client server appliction and in this when i stop the service from the server i have to terminate the process but i dont want to terminate it  i.e closing the port without terminating the service host process

System.Runtime.InteropServices.COMException (0x800A03EC): Microsoft Excel cannot open or save any mo


Hello good people, 

I have this beast as an error. Did my research and found some posts here as well but did not do any good for me. 

Here is what I did. I had an error regarding issue rights with COM objects so I gave access rights under component services for Microsoft Excel application now I am getting this error. 

Here is some information regarding this

1. Gave rights to ASPNET and network service to my web app directory to try to fix this error. 

2. The exact same process works on my Windows 2003 server and my Windows 7 development machine. I am trying to get this going on a different windows 2003 machine that is outside of our domain.

3. Developing on windows 7 64 bit with office 2010 installed. Also excel 2010 is installed on my Web server

4. Here is the code that is causing the error: The last line is causing the error.:

            MyXl = new Microsoft.Office.Interop.Excel.Application();
            MyXl.Visible = false;
            MyWb = (Microsoft.Office.Interop.Excel._Workbook)(MyXl.Workbooks.Add(Missing.Value));
            int test = 0; 
            MySheet = (Microsoft.Office.Interop.Excel._Worksheet)MyXl.ActiveSheet;
            if (reader.HasRows)
                int InRow = 2; 
                for (int i = 0; i < Nu

Remoting: Managing the Lifetime of Remote .NET Objects with Leasing and Sponsorship


Leasing and sponsorship is the solution for managing the lifecycle of a remote object in .NET. Each object has a lease that prevents the local garbage collector from destroying it, and most distributed applications rely upon leasing. There are several ways in which objects and clients can extend the lease, including dedicated sponsor objects. In this article, the author explains leasing, shows how to configure it, and how it relates to the various remoting activation models. He then discusses design guidelines and options, along with their impact on throughput and performance. Additionally, he introduces a helper class used to automate the management of lease sponsors.

Juval Lowy

MSDN Magazine December 2003

Secure It: WS-Security and Remoting Channel Sinks Give Message-Level Security to Your SOAP Packets


As more organizations adopt XML-based Web Services, the need for message-level security has become evident. WS-Security, now supported in the Microsoft .NET Framework, addresses this need. Using the WS-Security framework, developers can implement channel sinks to intercept Remoting messages as they pass through the .NET Remoting infrastructure. The sink can read the message, change it, and pass it along. During this process, the message can be signed for added security. This article explains how to implement a Remoting channel sink that will modify the Remoting message by including a UserName token in the header, then sign the body using the token.

Neeraj Srivastava

MSDN Magazine November 2003

.NET Remoting: Create a Custom Marshaling Implementation Using .NET Remoting and COM Interop


The .NET Framework offers several methods for customizing the presentation of native .NET and COM object types. One such technique, custom marshaling, refers to the notion of specializing object type presentations. There are times, like when a legacy COM component needs to implement a new interface or when you need to make calls across process or machine boundaries, when custom marshaling saves the day. Elements of COM Interop permit the customizing of COM types while .NET Remoting offers the developer the ability to tailor native .NET types. This article examines these techniques.

Jim Sievert

MSDN Magazine September 2003

.NET Remoting: Secure Your .NET Remoting Traffic by Writing an Asymmetric Encryption Channel Sink


As .NET Remoting gains popularity in the enterprise space, it must meet business demands for trustworthy computing. Remoting traffic can be secured when objects are hosted in IIS, but when they aren't hosted in IIS, custom security solutions can be developed to secure them. This article provides an in-depth look at writing channel sinks for .NET. It also details the flow of data through custom channel sinks and explains the kinds of manipulations that can be performed on that data.

Stephen Toub

MSDN Magazine June 2003

Remoting from WebService throws: An existing connection was forcibly closed by the remote host

Hello everyone, I have a problem with using .NET remoting from webservice. When using remoting from console application, there is no problem. I suppose problem is somewhere in IIS. My system is Windows Vista. Thank you for any help. Best regards, Jozef

Which is more secure? ClientActivated / ServerActivated Remoting ?

Hi, I want to develop a client server model where multiple clients will be passing some data to a single server. I am using .Net remoting to acheive this. I was wondering which RemotingConfiguration should I go for (ClientActivated / ServerActivated)? Please help me analyse this. Thanks, Piyush Kumat

How to Pass higher Length of Byte Array to the remoting method

Dear all,I am using a windows application and the businness logic is present in the remote server.Once particular method takes bytearray as input parameter...Whenever the method call is made the function returns value .This is limited for the particular bytearray length. (4109228 bytes).If the length of bytearray crosses 4109228 bytes.I am getting an error that "input stream is not valid binary format".How to Pass higher Length of Byte Array to the remoting method... Greater than 4 MB?I believe something is missing in web.config or app.config...?What could be the issue...? Any sugesstions are welcome....ThanksRavikumar
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend