C
C#2y ago
2fur

❔ How to build ConsoleApp to Linux?

Hello I know there's a way to do it, but I dont know how. I actually working on windows(10) and using the net6.0 and publishing my consoleApp(c#) with ClickOnce, but it gives me only a .exe file. Please help devastated
20 Replies
Angius
Angius2y ago
Don't use clickonce
Thinker
Thinker2y ago
Where are you publishing the app to?
Denis
Denis2y ago
Afaik if you build a .net app on linux, it doesn't matter if you get an . exe You can still run it When I build my avalonia UI app on linux, I also get an .exe
Angius
Angius2y ago
But that exe won't run on Linux And ClickOnce itself is, IIRC, something Windows-specific So the solution is to build with a specific runtime flag Either through the CLI, dotnet publish --runtime linux-x64 or some such Or through the IDE's publish wizard thing
2fur
2furOP2y ago
Pc my friend told me, a linux server needs a emulator or something like this to run this Can I ask where specifically I need t o put it?
Angius
Angius2y ago
No need for an emulator The command I posted is a command line command Do you use Visual Studio?
2fur
2furOP2y ago
yes everything I understand, but i dont know, where put this command i know, thats dumb, sorry for that 😅 but i never used a console before
Angius
Angius2y ago
No need to use the console VS has the publish wizard or whatever it's called
2fur
2furOP2y ago
everything is okay, but i dont know to to get to the publish wizard
Angius
Angius2y ago
Uh, file -> publish?
2fur
2furOP2y ago
oh
Angius
Angius2y ago
Just guessing, been a while since I used VS If it's not there, I'll need a minute to run it and see where the option is lol
2fur
2furOP2y ago
np, i have public selection thats it, yeah?
Angius
Angius2y ago
¯\_(ツ)_/¯ Not sure what "public selection" is
2fur
2furOP2y ago
*publish
Angius
Angius2y ago
$publishgif
2fur
2furOP2y ago
❤️
Accord
Accord2y ago
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.
Want results from more Discord servers?
Add your server