App crashes in InitializeComponent();

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • MJ

    App crashes in InitializeComponent();

    I have a strange (to me) problem with a c# forms application that I am
    developing. The application is installed on approxmatly 30 Windows XP
    machines and until recently they all worked perfectly. However since I have
    updated the application to a new version one of the machines fails with an
    unhandled exception when the application starts. The code in program.cs
    works fine and anything before the InitializeCompo nent(); method in the main
    form. As soon as the aplication enters the InitializeCompo nent method it
    crashes with mention of a filenotfound exception.

    I have copied the application folder from the failing PC to a good PC and it
    works fine which leads me to believe that it must be a system file that is
    missing. Likewise if I copy the program folder from a good PC to the failing
    one it again fails.

    I have reinstalled the app and the .Net 2 framework but to no avail.

    Having only done "basic debugging" I'm now a bit stuck.

    Any help would be appreciated


  • chanmm

    #2
    Re: App crashes in InitializeCompo nent();

    Have you check the NTFS right on the failing PC?

    chanmm

    "MJ" <no_s_pam@belmo nt.co.ukwrote in message
    news:12j9iglcfo hts88@corp.supe rnews.com...
    >I have a strange (to me) problem with a c# forms application that I am
    >developing. The application is installed on approxmatly 30 Windows XP
    >machines and until recently they all worked perfectly. However since I have
    >updated the application to a new version one of the machines fails with an
    >unhandled exception when the application starts. The code in program.cs
    >works fine and anything before the InitializeCompo nent(); method in the
    >main form. As soon as the aplication enters the InitializeCompo nent method
    >it crashes with mention of a filenotfound exception.
    >
    I have copied the application folder from the failing PC to a good PC and
    it works fine which leads me to believe that it must be a system file that
    is missing. Likewise if I copy the program folder from a good PC to the
    failing one it again fails.
    >
    I have reinstalled the app and the .Net 2 framework but to no avail.
    >
    Having only done "basic debugging" I'm now a bit stuck.
    >
    Any help would be appreciated
    >

    Comment

    • MJ

      #3
      Re: App crashes in InitializeCompo nent();

      chanmm,

      Sorry but I don't know what you mean.

      MJ
      "chanmm" <chanmmn@hotmai l.comwrote in message
      news:%23ljtQqf8 GHA.4996@TK2MSF TNGP03.phx.gbl. ..
      Have you check the NTFS right on the failing PC?
      >
      chanmm
      >
      "MJ" <no_s_pam@belmo nt.co.ukwrote in message
      news:12j9iglcfo hts88@corp.supe rnews.com...
      >>I have a strange (to me) problem with a c# forms application that I am
      >>developing. The application is installed on approxmatly 30 Windows XP
      >>machines and until recently they all worked perfectly. However since I
      >>have updated the application to a new version one of the machines fails
      >>with an unhandled exception when the application starts. The code in
      >>program.cs works fine and anything before the InitializeCompo nent();
      >>method in the main form. As soon as the aplication enters the
      >>InitializeCom ponent method it crashes with mention of a filenotfound
      >>exception.
      >>
      >I have copied the application folder from the failing PC to a good PC and
      >it works fine which leads me to believe that it must be a system file
      >that is missing. Likewise if I copy the program folder from a good PC to
      >the failing one it again fails.
      >>
      >I have reinstalled the app and the .Net 2 framework but to no avail.
      >>
      >Having only done "basic debugging" I'm now a bit stuck.
      >>
      >Any help would be appreciated
      >>
      >
      >

      Comment

      • Stoitcho Goutsev \(100\)

        #4
        Re: App crashes in InitializeCompo nent();

        Does the message say what file is missing?
        Mybe you are trying to open a file that is not in the application folder and
        for some reason all machines have that file, but one.


        --
        HTH
        Stoitcho Goutsev (100)

        "MJ" <no_s_pam@belmo nt.co.ukwrote in message
        news:12j9iglcfo hts88@corp.supe rnews.com...
        >I have a strange (to me) problem with a c# forms application that I am
        >developing. The application is installed on approxmatly 30 Windows XP
        >machines and until recently they all worked perfectly. However since I have
        >updated the application to a new version one of the machines fails with an
        >unhandled exception when the application starts. The code in program.cs
        >works fine and anything before the InitializeCompo nent(); method in the
        >main form. As soon as the aplication enters the InitializeCompo nent method
        >it crashes with mention of a filenotfound exception.
        >
        I have copied the application folder from the failing PC to a good PC and
        it works fine which leads me to believe that it must be a system file that
        is missing. Likewise if I copy the program folder from a good PC to the
        failing one it again fails.
        >
        I have reinstalled the app and the .Net 2 framework but to no avail.
        >
        Having only done "basic debugging" I'm now a bit stuck.
        >
        Any help would be appreciated
        >

        Comment

        • MJ

          #5
          Re: App crashes in InitializeCompo nent();

          It's not quite as simple as that.
          See the following code which is the constructor of the main form:
          public Form1()

          {

          MessageBox.Show ("This message will show as normal");

          InitializeCompo nent();


          MessageBox.Show ("This message never shows as the application has now
          failed");

          }

          I am not aware of accessing any files outside of the application directory.

          MJ

          "Stoitcho Goutsev (100)" <100@100.comwro te in message
          news:eQyRDCg8GH A.568@TK2MSFTNG P05.phx.gbl...
          Does the message say what file is missing?
          Mybe you are trying to open a file that is not in the application folder
          and for some reason all machines have that file, but one.
          >
          >
          --
          HTH
          Stoitcho Goutsev (100)
          >
          "MJ" <no_s_pam@belmo nt.co.ukwrote in message
          news:12j9iglcfo hts88@corp.supe rnews.com...
          >>I have a strange (to me) problem with a c# forms application that I am
          >>developing. The application is installed on approxmatly 30 Windows XP
          >>machines and until recently they all worked perfectly. However since I
          >>have updated the application to a new version one of the machines fails
          >>with an unhandled exception when the application starts. The code in
          >>program.cs works fine and anything before the InitializeCompo nent();
          >>method in the main form. As soon as the aplication enters the
          >>InitializeCom ponent method it crashes with mention of a filenotfound
          >>exception.
          >>
          >I have copied the application folder from the failing PC to a good PC and
          >it works fine which leads me to believe that it must be a system file
          >that is missing. Likewise if I copy the program folder from a good PC to
          >the failing one it again fails.
          >>
          >I have reinstalled the app and the .Net 2 framework but to no avail.
          >>
          >Having only done "basic debugging" I'm now a bit stuck.
          >>
          >Any help would be appreciated
          >>
          >
          >

          Comment

          • Bruce Wood

            #6
            Re: App crashes in InitializeCompo nent();


            MJ wrote:
            It's not quite as simple as that.
            See the following code which is the constructor of the main form:
            public Form1()
            >
            {
            >
            MessageBox.Show ("This message will show as normal");
            >
            InitializeCompo nent();
            >
            >
            MessageBox.Show ("This message never shows as the application has now
            failed");
            >
            }
            >
            I am not aware of accessing any files outside of the application directory.
            >
            MJ
            ....but you still haven't posted the exact text of the message that
            you're getting when the application fails. Without that information,
            we're just guessing here.

            Comment

            • MJ

              #7
              Re: App crashes in InitializeCompo nent();

              I get an error offering to send the report to Microsoft. The error signature
              is as follows:

              EventType cls20r3 P1: planit.exe P2 1.0.0.0 P3 452f8119
              P4: planit P5: 1.0.0.0 P6: 452f8119 P7: 1f5 P8 9b
              P9: system.io.filen otfoundexceptio n

              MJ
              "Bruce Wood" <brucewood@cana da.comwrote in message
              news:1161116619 .017529.81500@i 42g2000cwa.goog legroups.com...
              >
              MJ wrote:
              >It's not quite as simple as that.
              >See the following code which is the constructor of the main form:
              >public Form1()
              >>
              >{
              >>
              >MessageBox.Sho w("This message will show as normal");
              >>
              >InitializeComp onent();
              >>
              >>
              >MessageBox.Sho w("This message never shows as the application has now
              >failed");
              >>
              >}
              >>
              >I am not aware of accessing any files outside of the application
              >directory.
              >>
              >MJ
              >
              ...but you still haven't posted the exact text of the message that
              you're getting when the application fails. Without that information,
              we're just guessing here.
              >

              Comment

              • Bruce Wood

                #8
                Re: App crashes in InitializeCompo nent();


                MJ wrote:
                I get an error offering to send the report to Microsoft. The error signature
                is as follows:
                >
                EventType cls20r3 P1: planit.exe P2 1.0.0.0 P3 452f8119
                P4: planit P5: 1.0.0.0 P6: 452f8119 P7: 1f5 P8 9b
                P9: system.io.filen otfoundexceptio n
                >
                MJ
                That's hard-core. My first guess would be that there is something wrong
                with the install of .NET on that machine. I would uninstall and then
                reinstall .NET on that machine and see if that fixes the problem.

                Comment

                • Stoitcho Goutsev \(100\)

                  #9
                  Re: App crashes in InitializeCompo nent();

                  Bruce,

                  It is not necessary that a file your application creates and uses is
                  missing. It could be system or third party dll. .NET loads assemblies on
                  demand that's why it is absolultely possible that in the code you posted the
                  first msg box shows up and the second doesn't.

                  If it is possible try to debug you application in that machine, reinstall
                  ..NET framework and make sure that if you use some third party dlls in for
                  the GAC they are isnatalled.


                  --
                  Stoitcho Goutsev (100)


                  "Bruce Wood" <brucewood@cana da.comwrote in message
                  news:1161116619 .017529.81500@i 42g2000cwa.goog legroups.com...
                  >
                  MJ wrote:
                  >It's not quite as simple as that.
                  >See the following code which is the constructor of the main form:
                  >public Form1()
                  >>
                  >{
                  >>
                  >MessageBox.Sho w("This message will show as normal");
                  >>
                  >InitializeComp onent();
                  >>
                  >>
                  >MessageBox.Sho w("This message never shows as the application has now
                  >failed");
                  >>
                  >}
                  >>
                  >I am not aware of accessing any files outside of the application
                  >directory.
                  >>
                  >MJ
                  >
                  ...but you still haven't posted the exact text of the message that
                  you're getting when the application fails. Without that information,
                  we're just guessing here.
                  >

                  Comment

                  • Marc Gravell

                    #10
                    Re: App crashes in InitializeCompo nent();

                    If it is, as suggested, a missing assembly, then you should be able to watch
                    the output in debug mode to see what assemblies are loaded. Make sure that
                    anything non-framework is included as appropriate (EULA permitting...).

                    Other than that... does the initialisation code attempt e.g. to load an
                    image from the disk that isn't included?

                    Marc


                    Comment

                    Working...