簡體   English   中英

C#App發布后無法正常工作,為什么?

[英]C# App is not working after published, why?

我在i7英特爾,Windows 7 Ultimate,VS2010 Ultimate中創建,構建和發布該應用程序。 在這台機器上,應用程序正在運行以使用代碼。 在另一台機器上不起作用,為什么。 在此先感謝,ocaccy。

if(!Directory.Exists("C:\\users"))
{
DirectoryInfo di=Directory.CreateDirectory("C:\\users");
}

IniFile ini=new IniFile("C:\\users\\monitoring_config.ini");

Error Message on created machine:
************** Exception text **************
System.NullReferenceException: Object reference not set to an instance of an object.
   Local MonitorX.CommPort.Open()
   Local MonitorX.Monitor.checkConfigINI()
   Local MonitorX.Monitor.btn_Preferences_Click(Object sender, EventArgs e)
   Local System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   Local System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   Local System.Windows.Forms.Control.WndProc(Message& m)
   Local System.Windows.Forms.ButtonBase.WndProc(Message& m)
   Local System.Windows.Forms.Button.WndProc(Message& m)
   Local System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)..........................................................

也許您指向的文件丟失了。 如果不是,則可能缺少文件條目。

希望我能幫你一點

也許您不允許使用C:\\或C:\\ Users編寫。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM