Strange bug in Visual Studio

OK, It has been a long time I never post about programming here although I am supposed to be software engineer (or probably more IT consultant for last 1 year). I encountered this strange bug which cause cannot be identified.

So, basically my program is supposed to compute certain amount of money to certain group of people. There is a case whereby the computation went wrong and I need to check this particular person by inserting breakpoint to check local variable…

Breakpoint Bug 1

 

I am supposed to insert break point at line 210, so I saved the file, cleaned and rebuild the project, put the break point there and then start debugging my C# console application project.

Then, to my frustration, the break point always shifted to next line upon program execution:

Breakpoint Bug 2

 

I tried to restart the Visual Studio, reclean and rebuild solution, playing around with project Properties page and so on, with no success. I have also tried to tweak the debugging statement:

By adding curly bracket:

Breakpoint Bug 3

By adding another variable:

Breakpoint Bug 4

Still no success….Then after around 1 hour, I found that I need to modify the statement to the following…

Breakpoint Bug 5

It turned out that Microsoft Visual Studio cannot insert break point to the variable assignment to constant value…which is very strange. After around 10 years studying programming, I just knew about such limitation -.-.

 

Advertisements

About edwin2026

I am currently Indonesian expatriate working in Singapore, graduated from Nanyang Technological University with major in Computer Science in 2009. I am also working as software engineer, developing and maintaining systems for Singapore civil service. I write this blog to share to readers about my life principle on various aspects, like religion, politics, business, relationship, and technology. I am interested in alternative worldviews because I found that many things taught to us by establishments are not true and harmful. My dream is to become self-sufficient in food and energy. Hopefully, someday I can have my own fruit garden and my own power plant and able to sell my electricity to power company. I hope readers enjoy my blog.
This entry was posted in Technology and tagged , , , , , . Bookmark the permalink.

3 Responses to Strange bug in Visual Studio

  1. yuku says:

    This is interesting! Did you find any mention about this issue somewhere else?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s