Problem with Calling builded exe from another form
-
Hey @all I wish a very good new year 2021 to you :) I am from Germany and new in here and I have already read many interesting articles. I have a problem and whether google knows sth about that than me. I try to explain it to you now. I am designing a testing environment which i am appealing to via CAN-Bus and a 2 Channel CAN Interface. It all runs on C# with VS2019. I use one form to communicate to my test environment CAN Channel. Another form is used for CAN on my tested device. in the third form I designed my GUI. So far it is working very well. I builded the .exe and copied it to another directory. Now I try to start this exe with another form, called launcher, because i design many GUIs which are built to .exe files. Some of my GUIs start from the launcher, but some do not. One form of the CAN Interface is showing up, but is then closing. When I click on the exe in this directory directly, everything is working fine! But I only got it with 2 GUIs. The other 10 GUIs are working well in this. The Launcher is written on .netcore3.1. Also the GUIs are. I tried also with .net4.7.2, cause I am also using Measurement Studio of NI. I do not know any reason for that issue. I can not explain that to me :/ Does anybody have had an issue like that? If you need further Informations, please ask me for that. I am very desperasted on that. Thank you in advance. With best regards, Daniel
-
Hey @all I wish a very good new year 2021 to you :) I am from Germany and new in here and I have already read many interesting articles. I have a problem and whether google knows sth about that than me. I try to explain it to you now. I am designing a testing environment which i am appealing to via CAN-Bus and a 2 Channel CAN Interface. It all runs on C# with VS2019. I use one form to communicate to my test environment CAN Channel. Another form is used for CAN on my tested device. in the third form I designed my GUI. So far it is working very well. I builded the .exe and copied it to another directory. Now I try to start this exe with another form, called launcher, because i design many GUIs which are built to .exe files. Some of my GUIs start from the launcher, but some do not. One form of the CAN Interface is showing up, but is then closing. When I click on the exe in this directory directly, everything is working fine! But I only got it with 2 GUIs. The other 10 GUIs are working well in this. The Launcher is written on .netcore3.1. Also the GUIs are. I tried also with .net4.7.2, cause I am also using Measurement Studio of NI. I do not know any reason for that issue. I can not explain that to me :/ Does anybody have had an issue like that? If you need further Informations, please ask me for that. I am very desperasted on that. Thank you in advance. With best regards, Daniel
Member 14955332 wrote:
Some of my GUIs start from the launcher, but some do not. One form of the CAN Interface is showing up, but is then closing. When I click on the exe in this directory directly, everything is working fine!
How do you launch your exes? Are you using the exe's full pathname?
-
Member 14955332 wrote:
Some of my GUIs start from the launcher, but some do not. One form of the CAN Interface is showing up, but is then closing. When I click on the exe in this directory directly, everything is working fine!
How do you launch your exes? Are you using the exe's full pathname?
Hi, sorry for my late reply. i wanted to use relative paths. Now I tried with absolute patz directly on C:// it is the same problem. The exe is started but then the problem appeared. So Pathname is OK How I call the exe:
private void btStart\_Click(object sender, EventArgs e) { string opentest = "C:\\\\TesterV4\\\\Data\\\\Tests\\\\" + lbHersteller.SelectedItem.ToString() + "\\\\" + lbTests.SelectedItem.ToString() + "\\\\netcoreapp3.1\\\\Basis.exe"; try { Process p = new Process(); p.StartInfo.FileName = opentest; p.Start(); p.WaitForExit(); } catch { MessageBox.Show("Datei konnte nicht gefunden werden", "Fehler", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
-
Hi, sorry for my late reply. i wanted to use relative paths. Now I tried with absolute patz directly on C:// it is the same problem. The exe is started but then the problem appeared. So Pathname is OK How I call the exe:
private void btStart\_Click(object sender, EventArgs e) { string opentest = "C:\\\\TesterV4\\\\Data\\\\Tests\\\\" + lbHersteller.SelectedItem.ToString() + "\\\\" + lbTests.SelectedItem.ToString() + "\\\\netcoreapp3.1\\\\Basis.exe"; try { Process p = new Process(); p.StartInfo.FileName = opentest; p.Start(); p.WaitForExit(); } catch { MessageBox.Show("Datei konnte nicht gefunden werden", "Fehler", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
Maybe there is a similar problem (pathname) in the exe you are starting?
-
Hi, sorry for my late reply. i wanted to use relative paths. Now I tried with absolute patz directly on C:// it is the same problem. The exe is started but then the problem appeared. So Pathname is OK How I call the exe:
private void btStart\_Click(object sender, EventArgs e) { string opentest = "C:\\\\TesterV4\\\\Data\\\\Tests\\\\" + lbHersteller.SelectedItem.ToString() + "\\\\" + lbTests.SelectedItem.ToString() + "\\\\netcoreapp3.1\\\\Basis.exe"; try { Process p = new Process(); p.StartInfo.FileName = opentest; p.Start(); p.WaitForExit(); } catch { MessageBox.Show("Datei konnte nicht gefunden werden", "Fehler", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
-
Hi, sorry for my late reply. i wanted to use relative paths. Now I tried with absolute patz directly on C:// it is the same problem. The exe is started but then the problem appeared. So Pathname is OK How I call the exe:
private void btStart\_Click(object sender, EventArgs e) { string opentest = "C:\\\\TesterV4\\\\Data\\\\Tests\\\\" + lbHersteller.SelectedItem.ToString() + "\\\\" + lbTests.SelectedItem.ToString() + "\\\\netcoreapp3.1\\\\Basis.exe"; try { Process p = new Process(); p.StartInfo.FileName = opentest; p.Start(); p.WaitForExit(); } catch { MessageBox.Show("Datei konnte nicht gefunden werden", "Fehler", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
Contact Yahoo Support when you need it: 24×7 Yahoo Live Support gives you access to Yahoo specialists via telephone or online talk, 24 hours every day, 7 days per week. The specialists are prepared to help you with any of your Yahoo questions—from email to establishment, signing in, portable email, specialized inquiries, and that’s just the beginning.