Search
Setup for Free
C
C#
•
3y ago
elmish
❔ [FIXED] C# console app as .EXE problems
my C
# consoleapp breaks on second use but works just fine on first use
/when opened through VS2022
C#
Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,155
Members
View on Discord
Similar Threads
Was this page helpful?
Yes
No
© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
E
elmish
OP
•
4/18/23, 7:51 PM
On first use
E
elmish
OP
•
4/18/23, 7:52 PM
On second use
P
phaseshift
•
4/18/23, 7:53 PM
That is
very
difficult to diagnose without code
. Suggest you
$debug
P
phaseshift
That is _very_ difficult to diagnose without code. Suggest you $debug
M
MODiX
•
4/18/23, 7:53 PM
https://docs.microsoft.com/en-us/visualstudio/get-started/csharp/tutorial-debugger?view=vs-2022
Tutorial: Debug C# code - Visual Studio (Windows)
Learn features of the Visual Studio debugger and how to start the debugger
, step through code
, and inspect data in a C
# application
.
P
phaseshift
That is _very_ difficult to diagnose without code. Suggest you $debug
E
elmish
OP
•
4/18/23, 7:54 PM
https://github.com/Elmishhh/live-updating-compost-profit-checker/blob/main/Program.cs
GitHub
live-updating-compost-profit-checker/Program.cs at main · Elmishhh/...
uses api to calculate profits on the compost in hypixel skyblock
, just follow the instructions
- live
-updating
-compost
-profit
-checker
/Program
.cs at main
· Elmishhh
/live
-updating
-compost
-profit
-checker
E
elmish
OP
•
4/18/23, 7:54 PM
Heres the source
E
elmish
OP
•
4/18/23, 7:54 PM
And an install
E
elmish
OP
•
4/18/23, 7:54 PM
Its terrible code
E
elmish
OP
•
4/18/23, 7:55 PM
Because i suck at coding
P
phaseshift
•
4/18/23, 7:55 PM
webclient is outdated
- use HttpClient
E
elmish
OP
•
4/18/23, 7:56 PM
Is that the cause for the issue
?
P
phaseshift
•
4/18/23, 7:57 PM
doubt it if your problem is line 1210 which is just writing to console
?
E
elmish
OP
•
4/18/23, 7:58 PM
?
P
phaseshift
•
4/18/23, 7:58 PM
you
're saying line 1210 doesnt work
E
elmish
OP
•
4/18/23, 7:58 PM
No im saying the whole thing breaks on second use
E
elmish
OP
•
4/18/23, 7:59 PM
: becomes a lot of spaces
E
elmish
OP
•
4/18/23, 7:59 PM
Second time i launch the
.exe
E
elmish
OP
•
4/18/23, 7:59 PM
Per time i download it
P
phaseshift
•
4/18/23, 8:02 PM
looks like theyre writing concurrently or something
E
elmish
OP
•
4/18/23, 8:02 PM
?
E
elmish
OP
•
4/18/23, 8:03 PM
You can download it and see for yourself if it helps
P
phaseshift
•
4/18/23, 8:03 PM
no thanks
E
elmish
OP
•
4/18/23, 8:03 PM
Ok
P
phaseshift
looks like theyre writing concurrently or something
E
elmish
OP
•
4/18/23, 8:03 PM
Wdym here tho
P
phaseshift
•
4/18/23, 8:04 PM
multiple things writing to console at the same time
P
phaseshift
•
4/18/23, 8:04 PM
how do you run it the first time
, how do you end the first process
?
E
elmish
OP
•
4/18/23, 8:06 PM
I click the X button
E
elmish
OP
•
4/18/23, 8:11 PM
How am i supposed to close it
P
phaseshift
•
4/18/23, 8:13 PM
I don
't think its anything to do with being the second use then
P
phaseshift
•
4/18/23, 8:14 PM
I don
't see how a killed process can interfere with the second
E
elmish
OP
•
4/18/23, 8:18 PM
So with switching to HTTP should i just change the start of using webclient and client
.downloadstring to
HttpClient client = new(); var response = await client.GetAsync(url);
HttpClient client = new(); var response = await client.GetAsync(url);
P
phaseshift
•
4/18/23, 8:18 PM
you should use the same httpclient everywhere
, not make a new instance each time
P
phaseshift
•
4/18/23, 8:18 PM
(or useHttpClientFactory
)
P
phaseshift
•
4/18/23, 8:19 PM
I don
't know whats going wrong with your output to console
, though
E
elmish
OP
•
4/18/23, 8:19 PM
Maybe its caused by having so many warnings
?
P
phaseshift
•
4/18/23, 8:19 PM
no
E
elmish
OP
•
4/18/23, 8:20 PM
Idk how warning would affect second launch
E
elmish
OP
•
4/18/23, 8:20 PM
This is weird
E
elmish
OP
•
4/18/23, 8:23 PM
Does anyone know
?
E
elmish
OP
•
4/18/23, 8:33 PM
Anyone
?
P
phaseshift
•
4/18/23, 8:40 PM
suggest you debug it
E
elmish
OP
•
4/18/23, 8:40 PM
How
P
phaseshift
•
4/18/23, 8:40 PM
$debug
P
phaseshift
$debug
M
MODiX
•
4/18/23, 8:40 PM
https://docs.microsoft.com/en-us/visualstudio/get-started/csharp/tutorial-debugger?view=vs-2022
Tutorial: Debug C# code - Visual Studio (Windows)
Learn features of the Visual Studio debugger and how to start the debugger
, step through code
, and inspect data in a C
# application
.
E
elmish
OP
•
4/18/23, 8:44 PM
Yeah but it only happens when using a
.exe
, how do i debug the
.exe
P
phaseshift
•
4/18/23, 8:53 PM
when you run it from studio
/debugger
, its running the exe
P
phaseshift
•
4/18/23, 8:53 PM
Also you can attach to running processes
E
elmish
OP
•
4/19/23, 11:46 AM
it doesnt work
E
elmish
OP
•
4/19/23, 11:46 AM
per time i run it on pc restart
(per folder
) it works for the first time and then is broken after
E
elmish
OP
•
4/19/23, 11:47 AM
why is that happening
Next page
HttpClient
client
=
new
();
var
response
=
await
client.
GetAsync
(url);
HttpClient
client
=
new
();
var
response
=
await
client.
GetAsync
(url);
Similar Threads
❔ C# Console Application -> .exe
C
C# / help
3y ago
✅ C# Console App Calculator Help
C
C# / help
2d ago
✅ Learning C# through console app
C
C# / help
3y ago
convert c# to .exe
C
C# / help
9mo ago