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. C#
  4. FileNotFoundException error

FileNotFoundException error

Scheduled Pinned Locked Moved C#
helpcsharpdata-structuresdebuggingquestion
11 Posts 5 Posters 0 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.
  • U Offline
    U Offline
    User 4618787
    wrote on last edited by
    #1

    I'm getting the above exception where the heading for the Stack Trace is: {"The specified module could not be found. (Exception from HRESULT: 0x8007007E)":null} This is a windows application using c#.net 2008, and the code is as follows: private void formEmergePatDB_Load(object sender, EventArgs e) { // more code here ........ populate_Images(0, 19); //FileNotFoundException error on this line { public void populate_Images(int startImg, int endImg) { int img = 0; // more code here ........ { Before the populate_Images error the code performs many other similar requests with no problem? I can't imagine why it can't find the module, it is there and I am sending the appropriate arguments it asks for. Help Anyone!!!

    T A L S 4 Replies Last reply
    0
    • U User 4618787

      I'm getting the above exception where the heading for the Stack Trace is: {"The specified module could not be found. (Exception from HRESULT: 0x8007007E)":null} This is a windows application using c#.net 2008, and the code is as follows: private void formEmergePatDB_Load(object sender, EventArgs e) { // more code here ........ populate_Images(0, 19); //FileNotFoundException error on this line { public void populate_Images(int startImg, int endImg) { int img = 0; // more code here ........ { Before the populate_Images error the code performs many other similar requests with no problem? I can't imagine why it can't find the module, it is there and I am sending the appropriate arguments it asks for. Help Anyone!!!

      T Offline
      T Offline
      T_Teef
      wrote on last edited by
      #2

      i think its a memory error not sure. ;)

      1 Reply Last reply
      0
      • U User 4618787

        I'm getting the above exception where the heading for the Stack Trace is: {"The specified module could not be found. (Exception from HRESULT: 0x8007007E)":null} This is a windows application using c#.net 2008, and the code is as follows: private void formEmergePatDB_Load(object sender, EventArgs e) { // more code here ........ populate_Images(0, 19); //FileNotFoundException error on this line { public void populate_Images(int startImg, int endImg) { int img = 0; // more code here ........ { Before the populate_Images error the code performs many other similar requests with no problem? I can't imagine why it can't find the module, it is there and I am sending the appropriate arguments it asks for. Help Anyone!!!

        A Offline
        A Offline
        Adam Maras
        wrote on last edited by
        #3

        Can you paste us the contents of your populate_Images function?

        1 Reply Last reply
        0
        • U User 4618787

          I'm getting the above exception where the heading for the Stack Trace is: {"The specified module could not be found. (Exception from HRESULT: 0x8007007E)":null} This is a windows application using c#.net 2008, and the code is as follows: private void formEmergePatDB_Load(object sender, EventArgs e) { // more code here ........ populate_Images(0, 19); //FileNotFoundException error on this line { public void populate_Images(int startImg, int endImg) { int img = 0; // more code here ........ { Before the populate_Images error the code performs many other similar requests with no problem? I can't imagine why it can't find the module, it is there and I am sending the appropriate arguments it asks for. Help Anyone!!!

          L Offline
          L Offline
          Luc Pattyn
          wrote on last edited by
          #4

          Hi, lacking some of the essential information, here is a wild guess: populate_Images() is called successfully, but it contains either a reference to native code using P/Invoke, and some method is not found, or, more likely, it attempts to locate images from external modules (say DLL files) and one of them cannot be found. Check for a typo. Or show us the code; if you do PLEASE use the "code block" button below the edit window. :)

          Luc Pattyn [Forum Guidelines] [My Articles]


          - before you ask a question here, search CodeProject, then Google - the quality and detail of your question reflects on the effectiveness of the help you are likely to get - use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets


          U 1 Reply Last reply
          0
          • L Luc Pattyn

            Hi, lacking some of the essential information, here is a wild guess: populate_Images() is called successfully, but it contains either a reference to native code using P/Invoke, and some method is not found, or, more likely, it attempts to locate images from external modules (say DLL files) and one of them cannot be found. Check for a typo. Or show us the code; if you do PLEASE use the "code block" button below the edit window. :)

            Luc Pattyn [Forum Guidelines] [My Articles]


            - before you ask a question here, search CodeProject, then Google - the quality and detail of your question reflects on the effectiveness of the help you are likely to get - use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets


            U Offline
            U Offline
            User 4618787
            wrote on last edited by
            #5

            Thanks Luc for your help with this, and everyone else that is trying. Thing is, I have a break point on the 1st line of populate_Images routine, which is a simple var declaration, and that code never fires. The error actually happens on the calling line populate_Images(0, 19); Is it possible to error before it calls the routine? You are correct Luc, the routine uses ImageMagick to render the .pcx images onto 23 or so imageBoxes per page. Code is too much to post here, but here is a portion that uses imageMagick:

            public void populate_Images(int startImg, int endImg)
            {
            int img = 0; //BREAK POINT HERE : NEVER BREAKS

            etc, etc..............................              
            
                    //add images into ImageMagick 
                    for (intI = startImg; intI <= endImg; intI++)
                    {
                        var imageList = new ImageMagickNET.ImageList();		//THIS LINE HAS GIVEN ME TROUBLE THRU THE ENTIRE PROJECT
            
                        img += 1;
                            //driving from FileListBox 
                            string strIm1 = "\\\\\\\\swd4fs\\\\graphics\\\\" + (commonClass.parseIt(FileListBox.Path.ToString(), "Release")) + "\\\\";
                            string strIm2 = FileListBox.SelectedIndex.ToString();
                            imageList.ReadImages(strIm1 + strIm2);
            
            
                        //render 1 images at a time & display if available 
                        foreach (ImageMagickNET.Image image in imageList)
                        {
                            switch (img)
                            {
                                case 1:
                                    PictureBox1.Image = image.ToBitmap();
                                    break;
                                case 2:
                                    PictureBox2.Image = image.ToBitmap();
                                    break;
                                case 3:
                                    PictureBox3.Image = image.ToBitmap();
                                    break;
            
            		etc, etc..............................
            
                            }
                            break; 
                        }
            }
            

            imgaMagick works great in vs2005, been have lots of trouble integrating into vs2008. Thanks for your help

            L 1 Reply Last reply
            0
            • U User 4618787

              Thanks Luc for your help with this, and everyone else that is trying. Thing is, I have a break point on the 1st line of populate_Images routine, which is a simple var declaration, and that code never fires. The error actually happens on the calling line populate_Images(0, 19); Is it possible to error before it calls the routine? You are correct Luc, the routine uses ImageMagick to render the .pcx images onto 23 or so imageBoxes per page. Code is too much to post here, but here is a portion that uses imageMagick:

              public void populate_Images(int startImg, int endImg)
              {
              int img = 0; //BREAK POINT HERE : NEVER BREAKS

              etc, etc..............................              
              
                      //add images into ImageMagick 
                      for (intI = startImg; intI <= endImg; intI++)
                      {
                          var imageList = new ImageMagickNET.ImageList();		//THIS LINE HAS GIVEN ME TROUBLE THRU THE ENTIRE PROJECT
              
                          img += 1;
                              //driving from FileListBox 
                              string strIm1 = "\\\\\\\\swd4fs\\\\graphics\\\\" + (commonClass.parseIt(FileListBox.Path.ToString(), "Release")) + "\\\\";
                              string strIm2 = FileListBox.SelectedIndex.ToString();
                              imageList.ReadImages(strIm1 + strIm2);
              
              
                          //render 1 images at a time & display if available 
                          foreach (ImageMagickNET.Image image in imageList)
                          {
                              switch (img)
                              {
                                  case 1:
                                      PictureBox1.Image = image.ToBitmap();
                                      break;
                                  case 2:
                                      PictureBox2.Image = image.ToBitmap();
                                      break;
                                  case 3:
                                      PictureBox3.Image = image.ToBitmap();
                                      break;
              
              		etc, etc..............................
              
                              }
                              break; 
                          }
              }
              

              imgaMagick works great in vs2005, been have lots of trouble integrating into vs2008. Thanks for your help

              L Offline
              L Offline
              Luc Pattyn
              wrote on last edited by
              #6

              Hi,

              Member 4622089 wrote:

              THIS LINE HAS GIVEN ME TROUBLE THRU THE ENTIRE PROJECT

              tells me you are doing something wrong and have chosen to live with it. you should solve this.

              Member 4622089 wrote:

              BREAK POINT HERE : NEVER BREAKS

              I don't trust breakpoints that much. I prefer adding log statements to see the program evolving. the simplest log method is Console.WriteLine(string); If you don't need img right away the compiler might have moved it downwards. You are omitting to much code for us to help you. I suggest you start by adding a try{...} catch(Exception exc) {Console.WriteLine(exc.ToString());} first at the caller to populate_Images as well as inside populate_Images. Is it the first call to populate_Images that fails? is any image processed correctly before it fails? does it fail consistently? :)

              Luc Pattyn [Forum Guidelines] [My Articles]


              - before you ask a question here, search CodeProject, then Google - the quality and detail of your question reflects on the effectiveness of the help you are likely to get - use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets


              U 1 Reply Last reply
              0
              • L Luc Pattyn

                Hi,

                Member 4622089 wrote:

                THIS LINE HAS GIVEN ME TROUBLE THRU THE ENTIRE PROJECT

                tells me you are doing something wrong and have chosen to live with it. you should solve this.

                Member 4622089 wrote:

                BREAK POINT HERE : NEVER BREAKS

                I don't trust breakpoints that much. I prefer adding log statements to see the program evolving. the simplest log method is Console.WriteLine(string); If you don't need img right away the compiler might have moved it downwards. You are omitting to much code for us to help you. I suggest you start by adding a try{...} catch(Exception exc) {Console.WriteLine(exc.ToString());} first at the caller to populate_Images as well as inside populate_Images. Is it the first call to populate_Images that fails? is any image processed correctly before it fails? does it fail consistently? :)

                Luc Pattyn [Forum Guidelines] [My Articles]


                - before you ask a question here, search CodeProject, then Google - the quality and detail of your question reflects on the effectiveness of the help you are likely to get - use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets


                U Offline
                U Offline
                User 4618787
                wrote on last edited by
                #7

                Luc, your assumptions are incorrect. I have not chosen to live with it, I am currently attempting to get it to work. I need to render .pcx images and don't have another way of doing it in .NET, so I found imageMagick, which worked great in 2005 for over a year, and thought I'd be able to get it to work in 2008...it is what I am trying to solve. Breakpoints never gave me trouble, ever... the code never hits the module, it errors on it's call, therefore I'm not sure if it is imageMagick or something else. The code I'm omitting is just setting variables as flags, checking other flags for setting a tab panel control, clearing the imageBoxes, and redering 23 images instead of the few I actually posted. The code simply never gets to this routine at all. It is the populate_Images call that fails, consistently and it is the first call to this routine (which at this point is done on my initial page load). No images are rendered at this point, that is what the populate_Images routine does. Thanks for all your help

                L 1 Reply Last reply
                0
                • U User 4618787

                  Luc, your assumptions are incorrect. I have not chosen to live with it, I am currently attempting to get it to work. I need to render .pcx images and don't have another way of doing it in .NET, so I found imageMagick, which worked great in 2005 for over a year, and thought I'd be able to get it to work in 2008...it is what I am trying to solve. Breakpoints never gave me trouble, ever... the code never hits the module, it errors on it's call, therefore I'm not sure if it is imageMagick or something else. The code I'm omitting is just setting variables as flags, checking other flags for setting a tab panel control, clearing the imageBoxes, and redering 23 images instead of the few I actually posted. The code simply never gets to this routine at all. It is the populate_Images call that fails, consistently and it is the first call to this routine (which at this point is done on my initial page load). No images are rendered at this point, that is what the populate_Images routine does. Thanks for all your help

                  L Offline
                  L Offline
                  Luc Pattyn
                  wrote on last edited by
                  #8

                  OK, 1. something cannot be right. populate_Images() is a regular C# method, it is part of your code, so it does not need another file and it can't be missing or not be found. It can only go wrong inside populate_Images(). So I would add a log statement inside and see it gets executed. BTW what where the results from the try-catch? 2. ImageMagick is a library and optionally also an ActiveX component isn't it? When you install it, there are several checkboxes, one of them makes it available as an ActiveX component, did you check it during installation? 3. Is GetList() the first call into ImageMagick? Doesn't the library need some initialization? What is inside the ImageMagick constructor? Is the constructor your code, or is there a .NET wrapper available publicly? 4. Maybe something went wrong with its referencing, so I suggest you: - remove all ImageMagick stuff from your project (and from the GAC if you use it) - comment out the calls to it - re-add a reference to it - retype the statements using IM while watchinh intellisense works for it. :) -

                  Luc Pattyn [Forum Guidelines] [My Articles]


                  - before you ask a question here, search CodeProject, then Google - the quality and detail of your question reflects on the effectiveness of the help you are likely to get - use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets


                  U 1 Reply Last reply
                  0
                  • U User 4618787

                    I'm getting the above exception where the heading for the Stack Trace is: {"The specified module could not be found. (Exception from HRESULT: 0x8007007E)":null} This is a windows application using c#.net 2008, and the code is as follows: private void formEmergePatDB_Load(object sender, EventArgs e) { // more code here ........ populate_Images(0, 19); //FileNotFoundException error on this line { public void populate_Images(int startImg, int endImg) { int img = 0; // more code here ........ { Before the populate_Images error the code performs many other similar requests with no problem? I can't imagine why it can't find the module, it is there and I am sending the appropriate arguments it asks for. Help Anyone!!!

                    S Offline
                    S Offline
                    S Senthil Kumar
                    wrote on last edited by
                    #9

                    Here's what I would do. If the assembly containing the faulting code is unmanaged/mixed mode, I'd try opening it in Depends[^] and see if there are any missing dependencies. If it is managed, I'd try enabling Fusion logging [^] and checking out the exception stack trace for the missing dependency.

                    Regards Senthil [MVP - Visual C#] _____________________________ My Home Page |My Blog | My Articles | My Flickr | WinMacro

                    1 Reply Last reply
                    0
                    • L Luc Pattyn

                      OK, 1. something cannot be right. populate_Images() is a regular C# method, it is part of your code, so it does not need another file and it can't be missing or not be found. It can only go wrong inside populate_Images(). So I would add a log statement inside and see it gets executed. BTW what where the results from the try-catch? 2. ImageMagick is a library and optionally also an ActiveX component isn't it? When you install it, there are several checkboxes, one of them makes it available as an ActiveX component, did you check it during installation? 3. Is GetList() the first call into ImageMagick? Doesn't the library need some initialization? What is inside the ImageMagick constructor? Is the constructor your code, or is there a .NET wrapper available publicly? 4. Maybe something went wrong with its referencing, so I suggest you: - remove all ImageMagick stuff from your project (and from the GAC if you use it) - comment out the calls to it - re-add a reference to it - retype the statements using IM while watchinh intellisense works for it. :) -

                      Luc Pattyn [Forum Guidelines] [My Articles]


                      - before you ask a question here, search CodeProject, then Google - the quality and detail of your question reflects on the effectiveness of the help you are likely to get - use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets


                      U Offline
                      U Offline
                      User 4618787
                      wrote on last edited by
                      #10

                      Thanks again Luc. 1. I added a simple log file write to the module as well as wrapped the entire module in a Try...catch error handler, per your suggestion. On the catch I placed a simple Console.WriteLine(ex.Message); None of this code ever fires, the application stops with the original error at populate_Images(0,19); 2. my install of IM seems different from what you describe. I got the code from this site at:

                      http://www.codeproject.com/KB/dotnet/ImageMagick\_in\_VBNET.aspx

                      The instructions are to unzip 3 downloads onto a single folder in a specific order, than to run the install.bat (which is not included, though there are 3 others clean.bat, install-full.bat and install-safe.bat), so I ran the install-full.bat and opened the solution. ran it after copying the missing .dll to the bin/releaseq8 folder and chose the activex control to run. Took the compiled DLL and placed it along with the .pdb library for reference into my vs2008 folder and referenced them in the applications. Same I did on vs2005 the 1st time and it was great. 3. GetList() is not the 1st thing I do, on the:

                      public partial class formEmergePatDB : Form

                      before the form load I have the following code (not sure I need this, following the working vs2008):

                      public ImageMagickNET.ImageList imageList;

                      4. I will try to remove all IM references, but I don't see how that will change anything since the code never fires at all. Then I will re-compile and re-reference the dll and library and not sure what else, all of this seems like shots in the dark. Thank you so much for your time and patience Luc

                      L 1 Reply Last reply
                      0
                      • U User 4618787

                        Thanks again Luc. 1. I added a simple log file write to the module as well as wrapped the entire module in a Try...catch error handler, per your suggestion. On the catch I placed a simple Console.WriteLine(ex.Message); None of this code ever fires, the application stops with the original error at populate_Images(0,19); 2. my install of IM seems different from what you describe. I got the code from this site at:

                        http://www.codeproject.com/KB/dotnet/ImageMagick\_in\_VBNET.aspx

                        The instructions are to unzip 3 downloads onto a single folder in a specific order, than to run the install.bat (which is not included, though there are 3 others clean.bat, install-full.bat and install-safe.bat), so I ran the install-full.bat and opened the solution. ran it after copying the missing .dll to the bin/releaseq8 folder and chose the activex control to run. Took the compiled DLL and placed it along with the .pdb library for reference into my vs2008 folder and referenced them in the applications. Same I did on vs2005 the 1st time and it was great. 3. GetList() is not the 1st thing I do, on the:

                        public partial class formEmergePatDB : Form

                        before the form load I have the following code (not sure I need this, following the working vs2008):

                        public ImageMagickNET.ImageList imageList;

                        4. I will try to remove all IM references, but I don't see how that will change anything since the code never fires at all. Then I will re-compile and re-reference the dll and library and not sure what else, all of this seems like shots in the dark. Thank you so much for your time and patience Luc

                        L Offline
                        L Offline
                        Luc Pattyn
                        wrote on last edited by
                        #11

                        Hi, My suggestion about removing, then reinstalling the references to ImageMagick is based on the possibility you managed to build, then something happened to IM so the references got broken. Hence, the suggestion to re-establish references and rebuild. I happen to use a native (VB6) application that calls on ImageMagick (native code), so I know how to install that one. However I was unaware of any .NET version, or .NET wrapper, or the article you referred to. Thanks for the info though, it will be useful to me some day. The article has its own blog, you might want and post there, so the author or someone else might come up with something. I looked at the batch files, the full install needs two .reg files, did you find those? I didn't. Without them, the necessary registry entries will not be present; and with them, it may fail on Vista, because at last Vista implements some registry protection. Are you using Vista? Final tought: since there are lots of DLLs involved, one probably calling all the others, the folder holding them might need to appear in the Windows PATH environment variable. :)

                        Luc Pattyn [Forum Guidelines] [My Articles]


                        - before you ask a question here, search CodeProject, then Google - the quality and detail of your question reflects on the effectiveness of the help you are likely to get - use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets


                        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