简体   繁体   中英

C# App is not working after published, why?

I create, build and publish the app in i7 intel, Windows 7 Ultimate, VS2010 Ultimate. In this machine the app running up to use the code. In another Machine does not work, why. Thanks in advance, 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)..........................................................

Maybe the file you are pointing at is missing. If not may an entry of the file is missing.

Hope i could help you a little

也许您不允许使用C:\\或C:\\ Users编写。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM