3

I have a VB.Net program I'm working on. I had a piece of code that would email me the results as HTML in the body of the email. At some point the program got "Stuck" and did not execute any code changes in the form load. I have since completely removed everything from the form load, however it's still executing the code that emails the results.

What would cause the program to execute code that does not exist?

The only code that exists is below. However it's still filling a dataset, and emailing me results.

Dim TodayDt As DateTime = DateTime.Today
Dim Tomorrow As DateTime = DateTime.Today.AddDays(1)
Dim TodayEnd As DateTime
TodayEnd = Tomorrow.AddSeconds(-1)
Me.datasetTableAdapter.Fill(Me.dataset.set, TodayDt, TodayEnd)
Me.ReportViewer1.Refresh()
abatishchev
  • 98,240
  • 88
  • 296
  • 433
Shmewnix
  • 1,553
  • 10
  • 32
  • 66
  • 1
    perhaps stating the obvious, but is the old program still running in a different location/under a different user account...or for that matter, on a different machine? – DiskJunky Feb 20 '13 at 21:18
  • 2
    do a complete clean of the bin folder, rebuild the whole project, and then try it. – Servy Feb 20 '13 at 21:19
  • It's a visual studio program, I'm running it in debug mode. I have close the project, and even rebooted. – Shmewnix Feb 20 '13 at 21:19
  • Well, I have a total of 13 datasets in the project... I was hoping not to rebuild the entire project... – Shmewnix Feb 20 '13 at 21:20
  • 1
    If this is a website, you need to clear out the `Temporary ASP.NET Files` folder, after resetting IIS. See here: http://stackoverflow.com/questions/450831/what-is-the-temporary-asp-net-files-folder-for – Oded Feb 20 '13 at 21:21
  • Do a word search then for the key words that you are using `TodayDT` what is the Method Signature ..?? show that as well perhaps you have an overloaded Method with the same code can't really tell with that code snippet – MethodMan Feb 20 '13 at 21:21
  • it's not a website. vb.net windows application – Shmewnix Feb 20 '13 at 21:21
  • what is the mode under where you are running the code Debug or Release..? go to the folder and check the `Debug Folder` and `Release Folder` and see what the DateTime is on the file after you do a rebuild sounds like you are pointing at / testing the wrong build – MethodMan Feb 20 '13 at 21:22
  • @Shmewnix How does the number of data sets you have make re-compiling the project a problem? You need to have a very large codebase indeed to have your build process really take a long time. – Servy Feb 20 '13 at 21:23
  • Incidentally, if you are regarding "today" as <=23:59.59 and "tomorrow" as >=00:00:00, is there a chance of a stored time being 23:59:59.123 and slipping through your comparisons? – Andrew Morton Feb 20 '13 at 21:25
  • @Servy I was confused initially by your suggestion. It worked Great! Post as an answer, and i'll accept it. – Shmewnix Feb 20 '13 at 21:25

1 Answers1

2

Perform a clean and then rebuild of your project.

It's not all that uncommon for a build to be somehow corrupted, for the IDE to not realize that a source file has been updated, or any number of other problems somehow involving previous builds to leak into newer ones. These problems are almost always solved by getting rid of every last trace of previous builds (i.e. a Clean usually does it; there are more drastic measures if that doesn't work such as pulling down the code from source control again onto a clean directory) and then re-compiling.

It's also a good way of drawing attention to any problems recently introduced with you compilation process. If your project no longer builds you may have just been running an old build, or if you have some sort of problem that prevents a portion of your program from not working it's much better to have it just not work than to have it silently using an outdated version of that dependency.

Most of these principles apply to any development environment with a compilation step, although certain environments are more prone to errors than others.

Servy
  • 202,030
  • 26
  • 332
  • 449