❔ [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
32 Replies
On first use
On second use
That is very difficult to diagnose without code. Suggest you $debug
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.
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
Heres the source
And an install
Its terrible code
Because i suck at coding
webclient is outdated - use HttpClient
Is that the cause for the issue?
doubt it if your problem is line 1210 which is just writing to console?
?
you're saying line 1210 doesnt work
No im saying the whole thing breaks on second use
: becomes a lot of spaces
Second time i launch the .exe
Per time i download it
looks like theyre writing concurrently or something
?
You can download it and see for yourself if it helps
no thanks
Ok
Wdym here tho
multiple things writing to console at the same time
how do you run it the first time, how do you end the first process?
I click the X button
How am i supposed to close it
I don't think its anything to do with being the second use then
I don't see how a killed process can interfere with the second
So with switching to HTTP should i just change the start of using webclient and client.downloadstring to
you should use the same httpclient everywhere, not make a new instance each time
(or useHttpClientFactory)
I don't know whats going wrong with your output to console, though
Maybe its caused by having so many warnings?
no
Idk how warning would affect second launch
This is weird
Does anyone know?
Anyone?
suggest you debug it
How
$debug
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.
Yeah but it only happens when using a .exe, how do i debug the .exe
when you run it from studio/debugger, its running the exe
Also you can attach to running processes
it doesnt work
per time i run it on pc restart(per folder) it works for the first time and then is broken after
why is that happening
and only when using directly the exe
can anyone please help
i just want it to run normally
is newtonsoft the problem?
i doubt it
what can it be
why is it on the second use
only on the .exe
and only fixes when i restart my pc
0-0
its the multi line variable
OF COURSE IT IS
/closeticket
how do i close
!close
>:3
nope its every time i print a few lines at once
well not a few
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.