Click here to Skip to main content
15,887,083 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I have created a small test program based on .NET Remoting feature.

When running on a specific computer, I get the following exception:

mpRemotingServer.exe Assert Failure
mpRemotingServer.exe - Assert Failure
Expression: [mscorlib recursive resource lookup bug]
Description: Infinite recursion during resource lookup within mscorlib. This may be a bug in mscorlib, or potentially in certain extensibility points such as assembly resolve events or Culturelnfo names.
Resource name: Security_GenericNoType

The source code can be found at the following github link.

The usage is simple, it just invokes a sum on the server side.

When the computer is connected onto the company domain, it seems to work. It looks to me maybe an issue at the tcp level. I have tried adding security on the server side which is the one generating the exception but the problem persists.

Does somebody have already experience such issue.
Thank you very much in advance
Best regards.
MiQi

What I have tried:

On the server code, I have changed:

RemotingConfiguration.RegisterWellKnownServiceType(typeof (mpRemotingClass.RemoteOperations), "RemoteOperations", WellKnownObjectMode.Singleton);

// Changed to...
var remoteOperations = new mpRemotingClass.RemoteOperations(1);
RemotingServices.Marshal(remoteOperations, "RemoteOperations");

and the object definition is now:
public interface ICountingService
{
int Increment();
}

[Serializable]
public class RemoteOperations : MarshalByRefObject, ICountingService
{
    private static int _value = 0;

    public RemoteOperations(int startValue)
    {
        _value = startValue;
    }

    public int Increment()
    {
        // not threadsafe!
        _value++;
        return _value;
    }

    [System.Security.SecurityCritical]  // auto-generated
    public int sum(int a, int b)
    {
        return a + b;
    }
}

This still works fine on my test computer, but now sure so far it that will work on the target computer.

Do you have an advise to share with me ?
Thank you very much in advance
Posted
Updated 15-Oct-21 10:56am

1 solution

Just a warning. .NET Remoting has been dead for quite a long time now. It was replaced by Windows Communication Foundation back in the .NET 3.0 days.

Migrating from .NET Remoting to WCF - WCF | Microsoft Docs[^]
 
Share this answer
 
Comments
SuperMiQi 17-Oct-21 17:16pm    
Hello Dave,
Your comment is really understandable and I was indeed considering that option but as this section of the code still works on 99% of the time. This would be nice to get more information about the root cause of the exception before moving on Windows Communication Foundation strategy.
If you have any inputs which may be the cause, it would be a real pleasure to read them and exchange with you.
Thanks in advance.
Dave Kreskowiak 17-Oct-21 17:36pm    
Nope, and after Googling the error message, it seems nobody else has an answer either.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900