C
C#17mo 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
Angius17mo ago
Don't use clickonce
Thinker
Thinker17mo ago
Where are you publishing the app to?
Denis
Denis17mo 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
Angius17mo 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
2fur17mo 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
Angius17mo ago
No need for an emulator The command I posted is a command line command Do you use Visual Studio?
2fur
2fur17mo 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
Angius17mo ago
No need to use the console VS has the publish wizard or whatever it's called
2fur
2fur17mo ago
everything is okay, but i dont know to to get to the publish wizard
Angius
Angius17mo ago
Uh, file -> publish?
2fur
2fur17mo ago
oh
Angius
Angius17mo 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
2fur17mo ago
np, i have public selection thats it, yeah?
Angius
Angius17mo ago
¯\_(ツ)_/¯ Not sure what "public selection" is
2fur
2fur17mo ago
*publish
Angius
Angius17mo ago
$publishgif
2fur
2fur17mo ago
❤️
Accord
Accord17mo 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
More Posts