调用JIT调试而不是对话框 [英] Invoking JIT debugging instead of dialog box

查看:188
本文介绍了调用JIT调试而不是对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写了一个应用程序并制作了一个 exe ,在我自己的机器上运行,工作正常。

当点击'播放时,另一台机器上的同一个应用程序',它说:

I wrote an app and made an exe of it ,run it on my own machine, works fine.
The same app on another machine when clicked to 'play',it says:

See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at ReClient_ServerWinforms.Form1.Ping_all()
   at ReClient_ServerWinforms.Form1.Form1_Load(Object sender, EventArgs e)
   at System.Windows.Forms.Form.OnLoad(EventArgs e)
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl()
   at System.Windows.Forms.Control.WmShowWindow(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.Form.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll
----------------------------------------
ReClient_ServerWinforms
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Program%20Files%20(x86)/PureTechs%20Ltd/My%20Product%20Name/ReClient_ServerWinforms.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Configuration
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
 





我在我的App.config中启用了JIT:





I enabled JIT in my App.config as:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <startup> 
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
    </startup>
  <system.windows.forms jitDebugging="true"/>
</configuration>





但仍然是同样的错误让我无法运行应用程序。

为什么?



But still the same error doesn't let me the app to run.
Why?

推荐答案

嗯 - 调查它。也许检查主机文件:C:\ Windows \ System32 \ drivers \ etc \ hosts(例如,:: 1是localhost)或零是压缩所以它实际上是0:0:0:0或者网关没有真正的IP地址。

该方法似乎返回一个任意网关。我可以建议一些linq:

hmm - looking into it. Maybe check hosts file: "C:\Windows\System32\drivers\etc\hosts" (::1 is localhost for eg) or the zeros are compresses so it's actually 0: 0: 0: 0 or the gateway has no true ip address.
The method seems to return an arbitrary gateway. may I suggest some linq:
//Exact copy of your code in linq
    foreach (
        GatewayIPAddressInformation d in
        from f in NetworkInterface.GetAllNetworkInterfaces()
        where f.OperationalStatus == OperationalStatus.Up
        from d in f.GetIPProperties().GatewayAddresses
        select d)
    {
        ip = d.Address.ToString();
    }
    //This also gets all addresses:
    NetworkInterface.GetAllNetworkInterfaces()
        .Where(f => f.OperationalStatus == OperationalStatus.Up)
        .SelectMany(f=>f.GetIPProperties().GatewayAddresses)
        .Select(d=>d.Address)
//You can .First or .Last to get a single address, or check that the IP isn't "::"


这篇关于调用JIT调试而不是对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆