0
votes

I'm going to assume my installed version of .NET is foobared, but thought I would ask anyways as this makes no sense.

  1. Create a new C# Console Application
  2. Change Platform Target to Any CPU
  3. Run
  4. See a RemotingException be raised!?!

    'ConsoleApplication2.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_64\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll'
    'ConsoleApplication2.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\assembly\GAC_MSIL\Microsoft.VisualStudio.HostingProcess.Utilities\10.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.HostingProcess.Utilities.dll'
    'ConsoleApplication2.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Forms\v4.0_4.0.0.0__b77a5c561934e089\System.Windows.Forms.dll'
    'ConsoleApplication2.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll'
    'ConsoleApplication2.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll'
    'ConsoleApplication2.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\assembly\GAC_MSIL\Microsoft.VisualStudio.HostingProcess.Utilities.Sync\10.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.HostingProcess.Utilities.Sync.dll'
    'ConsoleApplication2.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\assembly\GAC_MSIL\Microsoft.VisualStudio.Debugger.Runtime\10.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.Debugger.Runtime.dll'
    'ConsoleApplication2.vshost.exe' (Managed (v4.0.30319)): Loaded 'e:\dev\ConsoleApplication2\ConsoleApplication2\bin\Debug\ConsoleApplication2.vshost.exe'
    'ConsoleApplication2.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll'
    'ConsoleApplication2.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml.Linq\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.Linq.dll'
    'ConsoleApplication2.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Data.DataSetExtensions\v4.0_4.0.0.0__b77a5c561934e089\System.Data.DataSetExtensions.dll'
    'ConsoleApplication2.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.CSharp\v4.0_4.0.0.0__b03f5f7f11d50a3a\Microsoft.CSharp.dll'
    'ConsoleApplication2.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_64\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll'
    'ConsoleApplication2.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll'
    The thread 'vshost.NotifyLoad' (0x1494) has exited with code 0 (0x0).
    The thread 'vshost.LoadReference' (0x12f0) has exited with code 0 (0x0).
    'ConsoleApplication2.vshost.exe' (Managed (v4.0.30319)): Loaded 'e:\dev\ConsoleApplication2\ConsoleApplication2\bin\Debug\ConsoleApplication2.exe', Symbols loaded.
    A first chance exception of type 'System.Runtime.Remoting.RemotingException' occurred in mscorlib.dll
    An unhandled exception of type 'System.Runtime.Remoting.RemotingException' occurred in mscorlib.dll
    
    Additional information: The async result object is null or of an unexpected type.
    

    mscorlib.dll!System.Runtime.Remoting.Proxies.RealProxy.EndInvokeHelper(System.Runtime.Remoting.Messaging.Message reqMsg, bool bProxyCase) + 0x2d0 bytes mscorlib.dll!System.Runtime.Remoting.Proxies.RemotingProxy.Invoke(object NotUsed, ref System.Runtime.Remoting.Proxies.MessageData msgData) + 0x191 bytes
    System.Windows.Forms.dll!System.Windows.Forms.Screen.AllScreens.get() + 0x1d2 bytes System.Windows.Forms.dll!System.Windows.Forms.Form.ApplyBoundsConstraints(int suggestedX, int suggestedY, int proposedWidth, int proposedHeight) + 0x12a bytes
    System.Windows.Forms.dll!System.Windows.Forms.Form.FillInCreateParamsStartPosition(System.Windows.Forms.CreateParams cp) + 0x4ab bytes
    System.Windows.Forms.dll!System.Windows.Forms.Form.CreateParams.get() + 0x153 bytes System.Windows.Forms.dll!System.Windows.Forms.Control.CreateHandle() + 0x146 bytes
    System.Windows.Forms.dll!System.Windows.Forms.Form.CreateHandle() + 0x2ad bytes System.Windows.Forms.dll!System.Windows.Forms.Control.Handle.get() + 0x68 bytes Microsoft.VisualStudio.HostingProcess.Utilities.dll!Microsoft.VisualStudio.HostingProcess.HostProc.RunParkingWindowThread() + 0xbd bytes
    mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool ignoreSyncCtx) + 0xdc bytes
    mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) + 0x3b bytes
    mscorlib.dll!System.Threading.ThreadHelper.ThreadStart() + 0x4d bytes
    [Native to Managed Transition]

1
Show the relevant code please.leppie
It is a fresh console application. I did not change one line. The exception is raised before Program.Main() is called.Spish
So, you do not have any remoting code? If so, that is strange. Try running it without using the 'hosting process' (option in project properties/debug).leppie
I have absolutely no remoting code. I have no code at all besides Program.Main(). Hmmm, seems that a full reboot has fixed the issue.Spish

1 Answers

0
votes

The problem is related to the execution path being too long. If it is over 127 character while executing as 64bit it goes pop. This is a .net 4 issue as far as im aware and the only thing that I've seen fix it is the make the entry assembly output name shorter. IMO, this is a rubbish fix and needs addressing by MS.

Edit: Solutions - Run as x86, or shorten project / user name