code builds but hangs while running
code: https://paste.pythondiscord.com/KTVQ
when i build it in release, everything works fine. but when i run in release, it just hangs and does nothing, even though all i'm doing is this:
97 Replies
Well, your
Main()
only calls DisplayHelp()
So... that's what runs
You never call Execute()
, for exampleWhat do you mean by hang? When I run the paste you sent it prints out the estring in DisplayHelp then exits
it just doesn't output:
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
add logs.. how?
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
there is zero output
did you read literally anything in the post
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
yes, of course
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
Execute()
isn't called because it's for later
yes
of course i read thatUnknown User•3mo ago
Message Not Public
Sign In & Join Server To View
yeah there's nothing wrong with the code
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
still no output
press enter
wtf is conhost
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
yeah i mentioned that in the post
build works fine
execution fails
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
navigate to the bin/release folder and run the executable created by building
it'll work fine
even stripping the entire file (singular C# file by the way) and writing this doesnt work:
yes
i tried that too
nope
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
pressing escape does nothing
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
Try running it from Powershell or VS Code's built-in terminal
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
i'm using vscode's terminal
i'll try powershell
is conhost just cmd?
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
it hangs in PS too
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
:hmmHD:
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
ah i see
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
i'm not using the window then
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
integrated terminal
it hangs there too
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
all i did was change
.Main()
to print hello world instead
Ctrl+C doesn't work to stop the terminal surprisinglyclick on the output tab
TeBeCo
add
-v:diag
Quoted by
<@689473681302224947> from #code builds but hangs while running (click here)
React with ❌ to remove this embed.
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
an absolute fuck ton of text is speeding through my terminal
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
scratch that, debug console, not output
debug console is empty
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
huh, odd
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
nope it stopped
like i said
building works fine
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
And are there any others?
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
it's in a single fileit doesn't need to be
Program.cs
- it just needs a .Main()
entry pointUnknown User•3mo ago
Message Not Public
Sign In & Join Server To View
If your code is too long, you can post to https://paste.mod.gg/, save, and copy the link into chat for others to see your shared code!
the chess bot i'm making on the side has an entry point in it's
UCI.cs
file - there it has top-level statements, which are essentially the same as a .Main()
entry point
no
which is why i'm confused as to why it's acting like this
i swear to god
if it's my anti-virus
i'm uninstalling thsi thingUnknown User•3mo ago
Message Not Public
Sign In & Join Server To View
it is, yes
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
HOLY FUCK
IT WAS MY ANTIVIRUS
i fucking hate this thing
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
Make some
D:/MyProjects
and use thatyou can do that?
Uh, yeah?
how do you make a D drive?
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
Or partition an existing one
But yeah,
C:/MyProjects
or whatever will do as well
I forgot not everybody has more than one drive loleither install another storage device, or if you free up some space, shrink your C drive volume and make a new volume using the disk management tool
windows defender is better than other antiviruses i swear
and it's free
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
a computer does what it's told to :shrug:
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
To be fair, the fact that OneDrive can cause such issues is... counterintuitive lol
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
yeah fair enough
my antivirus is nearly done uninstalling on the bright side
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
:thumbsup:
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
alright, will do
I'm curious why you're using these in conjunction with the
ThrowException
method that just prints out the parameters and calls Environment.Exit(0);
instead of throwing IndexOutOfRangeException
and OverflowException
with the message as one string passed into their constructorsi'd prefer not to use a stack trace, since it looks kinda ugly tbh
fair ig
i'd prefer to have just
than
though you shouldn't be using 0 as the argument for Environment.Exit in this case, since it isn't completing successfully
what happens when you exit with
1
?🤷♂️ mess around with it and see
seems like the exit code doesn't matter