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

    Question How to make software to run outside visual studio environment

    Hello,

    I need some help with this "simple" problem...
    my project solution looks like this:
    1. project written in cpp in order to operate some old api (also written in cpp) the output here is lib file.
    2. project that wrap the lib file and export a dll file
    3. main project, written in c# that basically makes GUI for the first project.

    when I compile wnd run in debug/release everything works fine.
    I tried to publish the main project, or make new installer project
    and everything looks ok except that when the program tries to works with the wrapper (my dll file) it crashes...

    does anyone have any idea??
    what do I need to do in order to run my software independently?

    Thanks Lior.

  2. #2
    Join Date
    Oct 2006
    Location
    Sweden
    Posts
    3,654

    Re: How to make software to run outside visual studio environment

    How does it crash? Don't you get any information?

    Does the target machine have the proper .NET & msvc runtime installed?
    Debugging is twice as hard as writing the code in the first place.
    Therefore, if you write the code as cleverly as possible, you are, by
    definition, not smart enough to debug it.
    - Brian W. Kernighan

    To enhance your chance's of getting an answer be sure to read
    http://www.codeguru.com/forum/announ...nouncementid=6
    and http://www.codeguru.com/forum/showthread.php?t=366302 before posting

    Refresh your memory on formatting tags here
    http://www.codeguru.com/forum/misc.php?do=bbcode

    Get your free MS compiler here
    https://visualstudio.microsoft.com/vs

  3. #3
    Join Date
    Mar 2013
    Posts
    4

    Re: How to make software to run outside visual studio environment

    The only information I get is that the wrapper is missing some files..
    my guess is that VS did not imported all necessary lib files (came with the API)
    but even when I get these files manually, it still doesnt work outside the VS.

  4. #4
    Join Date
    Oct 2006
    Location
    Sweden
    Posts
    3,654

    Re: How to make software to run outside visual studio environment

    Try adding both the msvc & .NET runtime to the installation. Also, your installation have to contain the release build since the debug runtime can't be distributed.
    Debugging is twice as hard as writing the code in the first place.
    Therefore, if you write the code as cleverly as possible, you are, by
    definition, not smart enough to debug it.
    - Brian W. Kernighan

    To enhance your chance's of getting an answer be sure to read
    http://www.codeguru.com/forum/announ...nouncementid=6
    and http://www.codeguru.com/forum/showthread.php?t=366302 before posting

    Refresh your memory on formatting tags here
    http://www.codeguru.com/forum/misc.php?do=bbcode

    Get your free MS compiler here
    https://visualstudio.microsoft.com/vs

  5. #5
    Join Date
    Mar 2013
    Posts
    4

    Question Re: How to make software to run outside visual studio environment

    Thank you for your help...
    I'll give some more details:

    the api I'm using is wvapi.h taken from Tornado 2.2 .
    the purpose of the program is to analyze vxWorks report..

    In order to do that, I had to add to the environment variables some definitions,
    add some additional include directories and make a lib project that communicates with this api.

    After that, I've wrapped the lib file in dll , add it to my project, put some GUI around it and everything worked perfectly but only under the VS2010 environment.. (both release and debug modes).

    The program is running. but, when I get to the part where I want to start analyzing a file,
    (this is the place in the code where a new instance of an object is generated, this object needs to communicate with the lib project)
    at this part I get an exception (its source is at the wrapper) that files are missing..
    and the program cannot start some functions..

    it looks like for some reason, my program does not know work the same in release mode and outside VS .

  6. #6
    Join Date
    Mar 2013
    Posts
    4

    Re: How to make software to run outside visual studio environment

    Anybody.... ???
    How can i run my app independently????

  7. #7
    Join Date
    Oct 2006
    Location
    Sweden
    Posts
    3,654

    Re: How to make software to run outside visual studio environment

    Windows has to be able to find the dlls your application depend on.

    If your application doesn't work when runned on the same machine as you use for developing it (i.e. outside Visual Studio) that indicates that the dll you've built can't be found. See here for how Windows search for dlls http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx

    If the issue occur on another PC .NET and/or msvc runtime might be missing on that machine.
    Debugging is twice as hard as writing the code in the first place.
    Therefore, if you write the code as cleverly as possible, you are, by
    definition, not smart enough to debug it.
    - Brian W. Kernighan

    To enhance your chance's of getting an answer be sure to read
    http://www.codeguru.com/forum/announ...nouncementid=6
    and http://www.codeguru.com/forum/showthread.php?t=366302 before posting

    Refresh your memory on formatting tags here
    http://www.codeguru.com/forum/misc.php?do=bbcode

    Get your free MS compiler here
    https://visualstudio.microsoft.com/vs

Tags for this Thread

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