CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 10 of 10
  1. #1
    Join Date
    Feb 2011
    Posts
    7

    [RESOLVED] Unable to run the exe created by c# application

    I have created an application in c#(vs 2008) dot net and builded it is release mode. It has no dll dependency. I have added a com reference for the application as it contains excel file read/write operations.

    I have tried to invoke the exe in other machine and found that it is not working. I installed miscosoft dot net frame work and still it is giving error message and I am not able to run the application. Kindly give me the solution for that

  2. #2
    Join Date
    Feb 2011
    Posts
    7

    Re: Unable to run the exe created by c# application

    I have added the reference "Microsoft Excel 12.0 Object Library" from the 'COM' tab under Add reference for the project. I have no seperate dlls as reference for the application.

  3. #3
    Join Date
    Oct 2004
    Posts
    206

    Re: Unable to run the exe created by c# application

    What error message do you get?
    Is Excel installed on the machine in question?

  4. #4
    Join Date
    Feb 2011
    Posts
    7

    Re: Unable to run the exe created by c# application

    Thanks for replying.

    The application itself is not launched.

    I have the excel installed in the test system.

    The error message is: The application needs to be closed. Windows encountered a problem.

  5. #5
    Join Date
    Feb 2011
    Posts
    7

    Re: Unable to run the exe created by c# application

    Please find the error attachments as below
    Attached Images Attached Images  

  6. #6
    Join Date
    Oct 2004
    Posts
    206

    Re: Unable to run the exe created by c# application

    A DirectoryNotFound exception is being thrown that you're not handling.

    Your code is looking for a directory that doesn't exist on the machine.

    So, you need to add some error handling and/or create the directory.

  7. #7
    Join Date
    Feb 2011
    Posts
    7

    Re: Unable to run the exe created by c# application

    Thanks for the reply.

    You are 100% correct.

    I searched through the code and found that one of the directory/file doesnt exist in the client machine.

    I created the directory and now it is working fine.

    But how did you identify that the directory is missing? Is it from the error code?

    Once again thanks for the reply.

  8. #8
    Join Date
    Feb 2011
    Posts
    7

    Re: Unable to run the exe created by c# application

    I saw the error message
    p9: system.io.directorynot found.

    Any way thanks for the reply.

  9. #9
    Join Date
    Oct 2004
    Posts
    206

    Re: Unable to run the exe created by c# application

    You're welcome. You should mark this thread as resolved if your problem is gone.

  10. #10
    Join Date
    Jun 2008
    Posts
    2,477

    Re: Unable to run the exe created by c# application

    Quote Originally Posted by vardhi@gmail.com View Post
    Thanks for the reply.
    But how did you identify that the directory is missing? Is it from the error code?
    Searching and reading through the documentation usually works.

    Code:
    if( Directory.Exists( @"SomePath" ) )
    {
    
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured