none
System.ComponentModel.Win32Exception RRS feed

  • Question

  • Background
     I am using a C# program with VS 2003
    We are using the program to run a piece of manufacturing equipment. We built a similar machine and copied the code into the new computer and made a bunch of changes to fit the changes in the equipment.
    The program and machine runs fine in debug mode but when I tried to build in release mode the problems began. First I got the error:

    An unhandled exception of type 'System.ComponentModel.Win32Exception' occurred in system.dll

    Additional information: The system cannot find the file specified

    I removed and reinstalled the reference, opened up the permissions on pretty much the whole computer, made sure nothing is read only, made sure the path is correct in properties, made sure the path is in the dependencies search path list, and copied and pasted the dll itself into all kinds of folders around the project.

    Finally I used regasm and that error went away but now I am getting:

    An unhandled exception of type 'System.ComponentModel.Win32Exception' occurred in system.dll

    Additional information: The system cannot find the file specified

    From what little I have found on the internet this problem is not with the system dll itself but can occur when any file path is wrong. I do not know how to find out specifically where this problem is.

    Any suggestions.






    Friday, October 17, 2008 5:36 AM

Answers

  • Thank-you. I have found the problem. In the code there is:

            Process spectrum=new Process();
            spectrum.StartInfo.FileName="spectrum.exe";
            spectrum.StartInfo.Arguments="";
            spectrum.Start();

    I commented this out and it built in release so apparently the exe is not in the path the dll is expecting it in or I need to specify. Looking into it I was told that the original machine does not have this feature working either so I guess the last guy never got it right either.

    I still can't try out the setup.exe because it says the .ini file is missing but the program runs without VS so that will get me back to the USA even if I don't make any more progress.

    Thanks again

    • Marked as answer by Bob13873 Friday, October 17, 2008 8:27 AM
    Friday, October 17, 2008 7:12 AM

All replies

  • Probably you are missing a dll, after the build copy the contents of the bin\release "as it is" and try. 
    BRS
    Friday, October 17, 2008 6:42 AM
  • Thank-you. I have found the problem. In the code there is:

            Process spectrum=new Process();
            spectrum.StartInfo.FileName="spectrum.exe";
            spectrum.StartInfo.Arguments="";
            spectrum.Start();

    I commented this out and it built in release so apparently the exe is not in the path the dll is expecting it in or I need to specify. Looking into it I was told that the original machine does not have this feature working either so I guess the last guy never got it right either.

    I still can't try out the setup.exe because it says the .ini file is missing but the program runs without VS so that will get me back to the USA even if I don't make any more progress.

    Thanks again

    • Marked as answer by Bob13873 Friday, October 17, 2008 8:27 AM
    Friday, October 17, 2008 7:12 AM