Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. Problem with Calling builded exe from another form

Problem with Calling builded exe from another form

Scheduled Pinned Locked Moved .NET (Core and Framework)
csharphelpcomdesigntesting
6 Posts 4 Posters 8 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Member_14955332
    wrote on last edited by
    #1

    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

    V 1 Reply Last reply
    0
    • M Member_14955332

      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

      V Offline
      V Offline
      Victor Nijegorodov
      wrote on last edited by
      #2

      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?

      M 1 Reply Last reply
      0
      • V Victor Nijegorodov

        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?

        M Offline
        M Offline
        Member_14955332
        wrote on last edited by
        #3

        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);
                }
            }
        
        V L D 3 Replies Last reply
        0
        • M Member_14955332

          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);
                  }
              }
          
          V Offline
          V Offline
          Victor Nijegorodov
          wrote on last edited by
          #4

          Maybe there is a similar problem (pathname) in the exe you are starting?

          1 Reply Last reply
          0
          • M Member_14955332

            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);
                    }
                }
            
            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            The only way you are going to resolve this is to add some logging/debugging code to the started program. It is impossible for anyone here to guess what it is doing.

            1 Reply Last reply
            0
            • M Member_14955332

              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);
                      }
                  }
              
              D Offline
              D Offline
              derlynnss
              wrote on last edited by
              #6

              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.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups