0

我将假设我安装的 .NET 版本是 foobared,但我想我还是会问,因为这没有任何意义。

  1. 创建一个新的 C# 控制台应用程序
  2. 将平台目标更改为任何 CPU
  3. 看到引发了 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 字节 mscorlib.dll!System.Runtime.Remoting.Proxies.RemotingProxy.Invoke(object未使用,参考 System.Runtime.Remoting.Proxies.MessageData msgData) + 0x191 字节
    System.Windows.Forms.dll!System.Windows.Forms.Screen.AllScreens.get() + 0x1d2 字节 System.Windows.Forms.dll!System .Windows.Forms.Form.ApplyBoundsConstraints(int建议X,int建议Y,int建议宽度,int建议高度)+ 0x12a字节
    System.Windows.Forms.dll!System.Windows.Forms.Form.FillInCreateParamsStartPosition(System.Windows.Forms.CreateParams cp ) + 0x4ab 字节
    System.Windows.Forms.dll!System.Windows.Forms.Form.CreateParams.get() + 0x153 字节 System.Windows.Forms.dll!System.Windows.Forms.Control.CreateHandle() + 0x146 字节
    System.Windows。 Forms.dll!System.Windows.Forms.Form.CreateHandle() + 0x2ad 字节 System.Windows.Forms.dll!System.Windows.Forms.Control.Handle.get() + 0x68 字节 Microsoft.VisualStudio.HostingProcess.Utilities。 dll!Microsoft.VisualStudio.HostingProcess.HostProc.RunParkingWindowThread() + 0xbd 字节
    mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback 回调, 对象状态, bool ignoreSyncCtx) + 0xdc字节
    mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback 回调,对象状态) + 0x3b 字节
    mscorlib.dll!System.Threading.ThreadHelper.ThreadStart() + 0x4d 字节
    [Native到托管过渡]

4

1 回答 1

0

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

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

于 2012-10-02T15:00:46.210 回答