title: What is causing mscorlib recursive resource lookup bug
body: <p>The error shown in the following screen shot occurs sporadically:</p>
  
  <p><a href="https://i.stack.imgur.com/uIAyM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uIAyM.png" alt="enter image description here"></a></p>
  
  <p>The application itself is in unmanaged C++, using COM objects, and .NET objects (in C# and VB) via COM interop.</p>
  
  <p>Only two functions from the stack trace are in our code</p>
  
  <p><strong>McWrapperControl.ControlHost.InvokeMethod</strong></p>
  
  <pre><code>Public Sub InvokeMethod(ByVal Member As String, ByVal NumArgs As Integer, ByVal Args As Object)
  
    Try
  
      Dim ArgsType As Type = Args.GetType()
      Dim ArgsArray As Object
  
      If NumArgs = 0 Then
        ArgsArray = Nothing
      ElseIf ArgsType.IsArray Then
        ArgsArray = Args
      Else
        ArgsArray = {Args}
      End If
  
      InvokeMethod_ArgsArray(Member, ArgsArray)
  
    Catch ex As Exception
      ReportError.ShowErrorDialog(ex, "")
    End Try
  
  End Sub
  </code></pre>
  
  <p>and <strong>McWrapperControl.ControlHost.InvokeMethod_ArgsArray</strong></p>
  
  <pre><code>Public Sub InvokeMethod_ArgsArray(ByVal Member As String, ByVal ArgsArray As Object)
  
    Try
  
      Dim Target As Object = ContainedControl()
      If Target IsNot Nothing Then
        Dim TargetType As Type = Target.GetType()
        TargetType.InvokeMember(Member, BindingFlags.InvokeMethod, Nothing, Target, ArgsArray)
      End If
  
    Catch ex As MissingMethodException
      'Ignore this error
    Catch ex As Exception
      ReportError.ShowErrorDialog(ex, "")
    End Try
  
  End Sub
  </code></pre>
  
  <p>In this case I am fairly certain that a MissingMethodException is occurring, but this should be caught and ignored. Obviously, I might be able to prevent this error by checking for the existence of the named method, before trying to invoke it.</p>
  
  <p>Aside from that, can anybody explain what might cause this recursion?</p>