2012-07-11 52 views
0

我已經編譯和.exe與Visual Studio 2008.在任何其他PC上的w7工作正常。但是與XP PC它給了我的錯誤,我不明白:vb 9 .exe將無法在XP上運行

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

************** Exception Text ************** 
System.NullReferenceException: Object reference not set to an instance of an object. 
at System.Drawing.Font..ctor(Font prototype, FontStyle newStyle) 
at PS.main_form.Button_search_click(Object sender, EventArgs e) 
at System.Windows.Forms.Control.OnClick(EventArgs e) 
at System.Windows.Forms.Button.OnClick(EventArgs e) 
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) 
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) 
at System.Windows.Forms.Control.WndProc(Message& m) 
at System.Windows.Forms.ButtonBase.WndProc(Message& m) 
at System.Windows.Forms.Button.WndProc(Message& m) 
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) 
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) 
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) 


************** Loaded Assemblies ************** 
mscorlib 
Assembly Version: 2.0.0.0 
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000) 

    CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll 

---------------------------------------- 
PS 
Assembly Version: 1.0.0.0 
Win32 Version: 1.0.0.0 

    CodeBase: file:///C:/Documents%20and%20Settings/jim/Desktop/PS.exe 

---------------------------------------- 
Microsoft.VisualBasic 
Assembly Version: 8.0.0.0 
Win32 Version: 8.0.50727.3053 (netfxsp.050727-3000) 

    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualBasic/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll 

---------------------------------------- 
System 
Assembly Version: 2.0.0.0 
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000) 

    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll 

---------------------------------------- 
System.Windows.Forms 
Assembly Version: 2.0.0.0 
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000) 

    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll 

---------------------------------------- 
System.Drawing 
Assembly Version: 2.0.0.0 
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000) 

    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll 

---------------------------------------- 
System.Configuration 
Assembly Version: 2.0.0.0 
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000) 

    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll 

---------------------------------------- 
System.Xml 
Assembly Version: 2.0.0.0 
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000) 

    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll 

---------------------------------------- 
System.Runtime.Remoting 
Assembly Version: 2.0.0.0 
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000) 

    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Runtime.Remoting/2.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll 

---------------------------------------- 
System.Data 
Assembly Version: 2.0.0.0 
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000) 

    CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll 

---------------------------------------- 
System.Transactions 
Assembly Version: 2.0.0.0 
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000) 

    CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Transactions/2.0.0.0__b77a5c561934e089/System.Transactions.dll 

---------------------------------------- 
System.EnterpriseServices 
Assembly Version: 2.0.0.0 
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000) 

    CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.EnterpriseServices/2.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.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> 

我在.net中新,所以請解釋清楚,我應該怎麼辦謝謝。

+1

我會猜測你的代碼假設**字體**的存在,它總是存在於Win7上,而不一定存在於XP上。但沒有**看到一些代碼**(例如'Button_search_click' ...),我只能猜測。 – AakashM 2012-07-11 08:38:50

回答

3

你是否試圖實例化未安裝在XP機器上的字體?也許是默認安裝了Windows 7而不是XP的一款軟件?


我的第1000堆棧溢出答案!

+0

有點像Consolas?恭喜你的第1000個答案!這是保持力 – pms1969 2012-07-11 08:43:53

+0

解決了這個問題。謝謝。如果我得到錯誤怎麼辦:應用程序未能正確初始化(0xc0000135)。單擊確定以終止該應用程序。這發生在一臺機器上,其他XP和w7我的應用程序工作正常。 – babboon 2012-07-11 12:16:31

+1

沒問題。建議你爲這個其他錯誤提出一個新問題。我不承認我的頭頂上的代碼,沒有人會在這個評論中找到它。我會有一個谷歌,但... – 2012-07-11 12:27:09

相關問題