Why VB.Net projects that were working OK suddenly fails to start now?
![](https://techprofile.blob.core.windows.net/images/LkhGAkKbwkeHLUvfCG8zrw.png?8D896F)
Hi all,
I have written many trial projects using VS 2013, VS 2019 and they were working fine for few years; Since the 1st week of March 2024, when I click "Start Debugging" / "Start without Debugging" any of those projects in Visual Studio to add new features / to test it, the program starts and closes immediately.
All those programs were working fine till that day. There is no error message. The program closes without showing any output.
This problem makes my hard works useless.
Could you please help me.
Thanks
VKSB
VB
Visual Studio Debugging
-
Viorel 115.1K Reputation points
2024-04-11T10:38:05.81+00:00 Did you put some breakpoints (using <F9>) in order to check if some initial code is achieved? You can also start the debugging using <F10>.
What kind of projects are you debugging and did you check some new projects?
-
Jiachen Li-MSFT 29,416 Reputation points • Microsoft Vendor
2024-04-11T12:59:50.9566667+00:00 Hi @VKSB ,
Is the problem prevalent in all of your projects, including if you create a new project?
-
VKSB 236 Reputation points
2024-04-11T17:40:26.92+00:00 Hi Viorel & Jiachen Li,
All my projects are Astrology related using "sweph" (https://www.astro.com/swisseph/swephinfo_e.htm)
"Is the problem prevalent in all of your projects, including if you create a new project?"
No, not all projects but several of the projects.
As I have been trying to solve this problem, I have not started any new project yet.
One of the project showed an error message for this:
Lon = Val(LongiDegTxtBox.Text) ' Lon as Double
The error message says the conversion is invalid or something like that so I changed it to
Lon = CDbl(LongiDegTxtBox.Text) ' Lon as Double
Then the error message disappeared but the project closes immediately. Now, as I want to get the exact "error" message to mention here, I changed it to the original one, and found there is no error message.
Thanks
VKSB
-
Anonymous
2024-04-12T08:34:53.0533333+00:00 Hi
As others have mentioned, BreakPoints and Single Stepping is the way to go.
I use the icon shown below to single step, there are also other key presses to do the same (I forget offhand which) . I would place a BreakPoint and if not reached (i.e. exception happens before that point in the code), then I would remove that BreakPoint and put another one at an earlier stage in the code. Repeat until the BreakPoint is reached, then, mouse click on that icon going line by line. When a line finally causes n exception, deal with it as the culprit has been found. Repeat until running normally.
I would also suggest putting these two lines (see below) at the very top of your code, lines 1 and 2. Doig this will bring up a 'lot' of errors etc., but you would benefit enormously if you make the effort and correct those and in the future you would make better code. It is very worthwhile doing this. You have already shown one example where a 'type' error stopped your code from running, there are probably many other similar possible 'crash points'.
' Put as lines 1 and 2 at very top Option Strict On Option Explicit On
-
VKSB 236 Reputation points
2024-04-12T11:32:05.32+00:00 Hi All,
Yes, I know I can use this technique (Step into). But I wonder why these projects that were working without any problems / error message all these time ( few years) suddenly give problem.
Could the cause be something to do with any update of Visual Studio / Windows 10 installed?
The error message I got for "Lon = Val(LongiDegTxtBox.Text) ' Lon as Double" didn't appear when I tried to get the error message to post here. Isn't it strange?
Thanks
VKSB
-
VKSB 236 Reputation points
2024-04-12T13:01:19.8833333+00:00 Deleted this message as the previous post now visible.
Sorry.
-
VKSB 236 Reputation points
2024-04-12T20:02:08.4633333+00:00 Hi,
I tried placing a Breakpoint & step into & found out that a "For Next" loop with an iteration of 14400 (This is to calculate a Planet's position every 1 Minute for 10 days) stops after 10 or 20 or more iterations without completing. No error message. I couldn't find out why it stops after a few iterations.
Please note this projects worked without any problem few weeks ago.
Any thought please?
Thanks
VKSB
-
Anonymous
2024-04-14T09:19:46.9433333+00:00 Hi
You will need to post some code. Start with the For....Next loop code, and details of the types and values of used variables in the loop,
-
Jiachen Li-MSFT 29,416 Reputation points • Microsoft Vendor
2024-04-15T07:14:47.2466667+00:00 Hi @VKSB ,
Please provide the relevant code and information so that we can help you.
Sign in to comment