Code Not Getting Executed In VB.NET

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Phil Galey

    Code Not Getting Executed In VB.NET

    I have a routine that calls a function that returns a boolean. If I paste
    the function call into the immediate command window, it runs the function
    and returns the correct result. However, if I let the program run the
    function, either in debug mode or even as a compiled executable, it does not
    execute the function and blindly returns True for the function and then
    continues to execute the rest of the routine.

    I have the configuration set for Debug mode and not Release, so that's not
    the cause. This problem started happening a few days ago and now affects
    many different programs that I have created in VB.NET and that did not
    previously exhibit this behavior. What could be the cause / solution of
    this problem? Please answer soon, while I still have my job. It not only
    impacts my debugging, even the compiled executable acts the same way! Is
    there a setting that would de-distasterize my VB.NET?

    Thanks.


  • Chris Dunaway

    #2
    Re: Code Not Getting Executed In VB.NET

    Without seeing the code for the function, it's difficult to know what
    the problem is. One thing you could try is to delete the bin folder of
    your app and then recompile.

    What happens when you step through the code? Can you put some
    Debug.WriteLine 's in the code to see if they get hit?

    Just some thoughts

    Comment

    • Chris, Master of All Things Insignificant

      #3
      Re: Code Not Getting Executed In VB.NET

      Might help if we see the code causing you problems.

      Chris

      "Phil Galey" <pagaley@starca lif.com.nospam> wrote in message
      news:uQaJt5hCFH A.1084@tk2msftn gp13.phx.gbl...[color=blue]
      >I have a routine that calls a function that returns a boolean. If I paste
      > the function call into the immediate command window, it runs the function
      > and returns the correct result. However, if I let the program run the
      > function, either in debug mode or even as a compiled executable, it does
      > not
      > execute the function and blindly returns True for the function and then
      > continues to execute the rest of the routine.
      >
      > I have the configuration set for Debug mode and not Release, so that's not
      > the cause. This problem started happening a few days ago and now affects
      > many different programs that I have created in VB.NET and that did not
      > previously exhibit this behavior. What could be the cause / solution of
      > this problem? Please answer soon, while I still have my job. It not only
      > impacts my debugging, even the compiled executable acts the same way! Is
      > there a setting that would de-distasterize my VB.NET?
      >
      > Thanks.
      >
      >[/color]


      Comment

      • Phil Galey

        #4
        Re: Code Not Getting Executed In VB.NET

        Thanks for your help. I figured out what the problem was ... in this case,
        anyway. The function call was the second item in a line with an AndAlso
        boolean operator, with the first item returning False; therefore it was by
        design that it was not executing the function. Sorry for the mistake.

        I have been experiencing a lot of the problem where it acts like Release is
        selected when Debug is actually selected, and where it sometimes says "There
        is no source code available for the current location.", and then after
        hitting F5, runs the rest of the code without allowing debugging. I still
        need to find a solution for that problem.

        Phil Galey


        "Phil Galey" <pagaley@starca lif.com.nospam> wrote in message
        news:uQaJt5hCFH A.1084@tk2msftn gp13.phx.gbl...[color=blue]
        > I have a routine that calls a function that returns a boolean. If I paste
        > the function call into the immediate command window, it runs the function
        > and returns the correct result. However, if I let the program run the
        > function, either in debug mode or even as a compiled executable, it does[/color]
        not[color=blue]
        > execute the function and blindly returns True for the function and then
        > continues to execute the rest of the routine.
        >
        > I have the configuration set for Debug mode and not Release, so that's not
        > the cause. This problem started happening a few days ago and now affects
        > many different programs that I have created in VB.NET and that did not
        > previously exhibit this behavior. What could be the cause / solution of
        > this problem? Please answer soon, while I still have my job. It not only
        > impacts my debugging, even the compiled executable acts the same way! Is
        > there a setting that would de-distasterize my VB.NET?
        >
        > Thanks.
        >
        >[/color]


        Comment

        • Chris, Master of All Things Insignificant

          #5
          Re: Code Not Getting Executed In VB.NET

          I've heard that when that happens delete the obj/pdb files then rebuild it
          can clear that up. Not sure but give it a try.

          Chris

          "Phil Galey" <pagaley@starca lif.com.nospam> wrote in message
          news:OazqSViCFH A.3592@TK2MSFTN GP09.phx.gbl...[color=blue]
          > Thanks for your help. I figured out what the problem was ... in this case,
          > anyway. The function call was the second item in a line with an AndAlso
          > boolean operator, with the first item returning False; therefore it was by
          > design that it was not executing the function. Sorry for the mistake.
          >
          > I have been experiencing a lot of the problem where it acts like Release
          > is
          > selected when Debug is actually selected, and where it sometimes says
          > "There
          > is no source code available for the current location.", and then after
          > hitting F5, runs the rest of the code without allowing debugging. I still
          > need to find a solution for that problem.
          >
          > Phil Galey
          >
          >
          > "Phil Galey" <pagaley@starca lif.com.nospam> wrote in message
          > news:uQaJt5hCFH A.1084@tk2msftn gp13.phx.gbl...[color=green]
          >> I have a routine that calls a function that returns a boolean. If I
          >> paste
          >> the function call into the immediate command window, it runs the function
          >> and returns the correct result. However, if I let the program run the
          >> function, either in debug mode or even as a compiled executable, it does[/color]
          > not[color=green]
          >> execute the function and blindly returns True for the function and then
          >> continues to execute the rest of the routine.
          >>
          >> I have the configuration set for Debug mode and not Release, so that's
          >> not
          >> the cause. This problem started happening a few days ago and now affects
          >> many different programs that I have created in VB.NET and that did not
          >> previously exhibit this behavior. What could be the cause / solution of
          >> this problem? Please answer soon, while I still have my job. It not
          >> only
          >> impacts my debugging, even the compiled executable acts the same way! Is
          >> there a setting that would de-distasterize my VB.NET?
          >>
          >> Thanks.
          >>
          >>[/color]
          >
          >[/color]


          Comment

          Working...