36 Replies
(on the command line)
--configuration Release
?always runso i dont need to add those extra arguments it's just an in-built setting
Shove it in a script and call
./build.ps1
🤷
I don't recommend defaulting to release anyway, not a lot of win. Most of the time you'll only need a release build when publishing to save on PDB size
I'm 99% sure you could do some hackery like
But Idk about that, not an MSBuild expert to say that this will actually do what you wantnot an MSBuild expertis there anyone here who is?
My question would be, why do you insist on local Release builds
im writing a chess engine and when i do something called a "perft test" (make a function that traverses the game tree and verifies your code works fine), i got about 50,000 nodes per second (extremely slow, i was seeing people get hundreds of millions of nodes per second)
and thats because i was (unknowingly) running it in debug mode. running it in release got me 12-18mnps
(i have sub-optimal hardware so thats expected)
Wouldn't just having a powershell script to run it for you suffice?
perftest.ps1
could just invoke dotnet run --configuration Release
for youcan i run that from vscode?
Sure you can
oh wow
how then?
lemme check if there are any extensions hold on
also is powershell the same as cmd
No need, you can just plop it into your launchsettings
Well there's the old windows command line which is generally called CMD, but PowerShell is a .NET-based shell
In this case it doesn't matter which one you use
ooh
do tell me more
oh ok. i'll just use PS then
wait how do you add to
launchsettings
?You might not even need it, let me try to do this manually in VSC
because this is all i have
👍
@LPeter1997 you good?
I've just installed the new VSC extension, I'm still trying to figure out the new json schema they have
Read back a little 😛
oh oops
you want a launch profile?
yeah (idk what that is)
so you can run from vscode
i recommend just a script tho
easier
you dont even need a script just ⬆️
yeah sure
just hit the play button and see results yk
that wont add a play button iirc
just allows you to run from the command bar thing
how do you add that then
probably with an extention
but youre putting too much effort into this'
I mean it should be trivial to add a launchsetting that just specifies release but C# DevKit of course provides absolute dogshit documentation
The schema doesn't even seem to include config as an option. You can do a pre-launch task to build a release version, won't use it to run that
I think I got it
So within the
.vscode
folder, you'd define a task to build a release. I did it like so (tasks.json
):
And also within .vscode
, defined a launchsetting to use the output DLL of the build (launch.json
):
I think this should work, it worked for meit keeps fucking building (in the default way)
i changed it to run in release
That will run it as part of your pre-launch task instead
whats a pre-launch task?
A task it performs... drum roll ... before launching
ohh
and forgive me if i sound naggy or annoying, but how does that relate to the run button?
Typically build
Well to run, you generally build first
Tools by default don't use
dotnet run
to run your thing
They first build
And then execute the built thing
This is what dotnet run
does as well in the background
The main reason for this separation is so that a debug adapter and a debugger can hook into your running app showing you the pretty crashes and whatnotohh ok i see
ahh ok i see it now
so how do i run it in release then?
wait
i can just clone the extension and edit the arguments
wow programming is amazing
The launch thing I gave you should launch the release built DLL
(Make sure that the launch setting with that name is selected in the debug/run tab)
ah ok works fine now