-
Apr 13th, 2025, 02:41 PM
#1
Thread Starter
New Member
vb.net published program crashes when drawing into picturebox
Hello,
I'm new here and not a pro, that's why i have to ask the professionals. I made a very simple program for my cousin, which has some textboxes to fill out and
doing some calculations with these inputs. After that you can click a button to draw lines into a picturebox, using the calculated and inserted numbers. In Visual Studio everything is fine,
working without any problems. I published the program, created a setup.exe (had to convert to .net 6.0 first) and let him install it. Now everytime he clicks the button to draw into the picturebox, the program crashes. His operating system is Windows 10 pro. I tried it on a different pc, and it worked without any problem. Maybe someone can help me with this, couldn't find any answer on google or anywhere else.
I think it's a problem with Windows 10 pro, but I'm not sure. Thanks in advance.
Thomas
-
Apr 13th, 2025, 07:05 PM
#2
Re: vb.net published program crashes when drawing into picturebox
It almost definitely isn't a problem with Windows 10 pro.
Did you both use the same input? Could be a .Net Core incompatibility
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Apr 13th, 2025, 10:40 PM
#3
Re: vb.net published program crashes when drawing into picturebox
A crash in an unhandled exception. You need to get the data from that exception because it tells you what the problem is. Windows should provide the information but you can also write code to catch the exception and log the information yourself. Do that and tell us what you find. You should also show us the relevant code. We may know more than you but we still need information to diagnose the issue.
-
Apr 14th, 2025, 06:25 AM
#4
Thread Starter
New Member
Re: vb.net published program crashes when drawing into picturebox
ok, thank You for Your answers. So how can I log whats happening. Just let print into a textfile on the computer in the try catch end try loop? But what do i have to write in that code, so that the problem is written down?
Then release/publish again and let him try, right?
-
Apr 14th, 2025, 07:39 AM
#5
Re: vb.net published program crashes when drawing into picturebox
You may not have to do anything. Usually, if an app crashes, Windows displays a dialogue with a Details button. For .NET apps, that will generally include the exception details. You can just get the user to copy that and provide it to you however is convenient.
As for catching the exception, unless it's something you can reasonable expect to happen, don't catch it explicitly. Add code to handle the UnhandledException event of the application, which you should always be doing anyway. You can then log the exception and shut down cleanly. It's up to you how to log it. You might just display it in a message box and have the user copy it and send it to you. It's completely up to you what's appropriate.
-
Apr 14th, 2025, 11:20 AM
#6
Thread Starter
New Member
Re: vb.net published program crashes when drawing into picturebox
ok, the problem is, there is no Windows dialogue. The program just closes without any error message. i browsed a little bit, and i think this code would do the job, am i right?
```
Code:
Catch ex As Exception
MsgBox(ex.Message)
My.Application.Log.WriteException(ex, TraceEventType.Error, "Exception " & "with argument " & "C:\Log.txt" & ".")
End Try
-
Apr 14th, 2025, 01:31 PM
#7
Re: vb.net published program crashes when drawing into picturebox
That is one way, yes. It might already be logged in the event viewer too, I would suggest checking there first.
-
Apr 15th, 2025, 12:43 AM
#8
Thread Starter
New Member
Re: vb.net published program crashes when drawing into picturebox
ok, the event viewer recorded the crash, that information is inside (some parts in german). But how can i read it. Looks like a dll problem?
System
- Provider
[ Name] Windows Error Reporting
- EventID 1001
[ Qualifiers] 0
Version 0
Level 4
Task 0
Opcode 0
Keywords 0x80000000000000
- TimeCreated
[ SystemTime] 2025-04-15T05:01:22.2090579Z
EventRecordID 282649
Correlation
- Execution
[ ProcessID] 0
[ ThreadID] 0
Channel Application
Computer Sonnenschutzdoktor
Security
- EventData
2245480069158270704
4
APPCRASH
Nicht verfügbar
0
Sonnenschutzdoktor Berechnungsapp.exe
0.0.0.0
670d0000
KERNELBASE.dll
10.0.19041.5678
024a42e4
c000041d
000000000003b699
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER8A31.tmp.WERInternalMetadata.xml
?
\\?\C:\ProgramData\Microsoft\Windows\WER\ReportArchive\AppCrash_Sonnenschutzdokt_c9ebb2d72221db35458 bc2f664993ba8efa29d1f_588a3b03_d3e4afc5-68f8-42ad-9e85-a9151634de8c
0
23dbe9a5-5192-4210-b5f8-24de1f6bbe5d
268435456
c55d980e4e9de446bf298c39d065f6f0
Last edited by jmcilhinney; Apr 15th, 2025 at 01:57 AM.
-
Apr 15th, 2025, 02:00 AM
#9
Re: vb.net published program crashes when drawing into picturebox
There's no exception data there. How about you do what I suggested - what I suggested you should already be doing because it should be done in every app that supports it - and handle the UnhandledException event of the application?
-
Apr 15th, 2025, 06:53 AM
#10
Thread Starter
New Member
Re: vb.net published program crashes when drawing into picturebox
ok, i try to implement a code to get the exception data from the program itself. I share the information as soon as i get it.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|