Published vs. debugging build of app (endless looping)


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Published vs. debugging build of app (endless looping)

  1. #1
    Join Date
    Aug 2007
    Posts
    5

    Unhappy Published vs. debugging build of app (endless looping)

    I finally have my vb app working the way I want it to when I run it in debug mode in visual studio express. But when I publish it to a regular .exe app using OneClick, it gets caught in an endless loop.

    When it runs properly (debugging through visual studio):

    STEP1: App launches input window form
    STEP2: User enters input into form and hits go button
    STEP3: App launches external process 1 and sends it user's input from form
    STEP4: App launches external process 2 (which accesses process 1 data)
    STEP5: App reads a log file to determine status of process 2
    STEP6: App launches external process 3 based on data from log file
    -- App waits while user sends input to process 3 --
    STEP7: When user exits Process 3, app kills processes 1 & 2 and then quits

    Here's how the published .exe build runs:

    STEP1: App launches input window form
    STEP2: User enters input into form and hits go button
    STEP3: App launches external process 1 and sends it user's input from form
    STEP4: App launches external process 2 (which accesses process 1 data)
    STEP5: App reads a log file to determine status of process 2
    STEP6: App launches external process 3 based on data from log file
    -- App loops back to STEP 3 repeatedly, launching numerous additional instances of processes 1, 2 and 3 (before I force quit the app)

    I then also have to manually force quit each of the additional instances of the external processes (the first time around 50 additional instances).

    I'm new to vb.net coding, and this is the first time I've ever "published" an app -- is this a common problem? I've done several searches and looked through the various books I have, but I can't find anything about this.

    Is there something I need to change in the publishing options? Or is this some kind of "threading" issue as to the external processes I'm launching?

    I imagine it must be pretty common for a published build to run a little differently than the debugging version of the app running through visual studio -- but this is completely different behavior, and because it is running as a standalone .exe, I can't "step" through it to see why it is looping this way...

    Any help would be appreciated, and thanks in advance.

  2. #2
    Join Date
    Sep 2007
    Posts
    86
    Noryk,

    I believe the problem you are seeing is that when you are debugging there is enough of a lag that each process finished doing work fast enought for the other process to read the data. When you run without debugging there is no telling how long it will take for Process 1 to do it's work and be ready for Process 2 to be able to read it's data. There are a number of ways to allow the different process to communicate information back and forth that will make sure the problem you are seeing doesn't happen.

    You could use a callback function, or message queues to pass the data back and forth. This would ensure that you can't run into the race condition you are seeing. Basically the callback function works by launching Process 1 and telling it which function in Process 2 to call when it has finished doing it's work so that Process 2 can read the data.

    Another way, which may be easier to implement, is message queues. You could then setup a queue for each process to use. When Process 1 is finished with it's work it could post a message to the Q. Process 2 would then launch and watch the Q for the message to appear before continuing on with the work and reading data that is not there yet.

    Here is a reference on implementing Callback Function:
    MSDN Website

    Here is one on Message Queues:
    MSDN Website


    I hope this helps!

    John Wiese
    ISV Architect Evangelist - Microsoft
    http://blogs.msdn.com/usisvde

Similar Threads

  1. Replies: 1
    Last Post: 10-03-2005, 10:16 AM
  2. Debugging my VB.Net Windows App
    By Jared25 in forum .NET
    Replies: 0
    Last Post: 05-24-2005, 09:54 AM
  3. How to make App B modal in App A?
    By Måns in forum VB Classic
    Replies: 2
    Last Post: 11-11-2000, 06:17 PM
  4. How to make App B modal in App A?
    By Måns in forum VB Classic
    Replies: 0
    Last Post: 11-08-2000, 08:28 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center