将Platform Target更改为任何CPU时引发的神秘RemotingException

时间:2012-07-31 06:51:46

标签: c#

我将假设我安装的.NET版本已经失效,但我想我会问,因为这没有任何意义。

  1. 创建新的C#控制台应用程序
  2. 将平台目标更改为任何CPU
  3. 运行
  4. 看到RemotingException被引发了!?!

    '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(对象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回调,对象状态)+ 0x3b字节
          mscorlib.dll!System.Threading.ThreadHelper.ThreadStart()+ 0x4d bytes
          [原生于管理过渡]

1 个答案:

答案 0 :(得分:0)

问题与执行路径太长有关。如果它在执行64位时超过127个字符则会弹出。这是一个.net 4问题,据我所知,我见过的唯一修复它的是使条目程序集输出名称更短。国际海事组织,这是一个垃圾修复,需要MS解决。

编辑:解决方案 - 以x86运行, 或缩短项目/用户名