C
C#13h ago
Muckelodien

convert c# to .exe

hey, can anyone convert this file to .exe? Iwatched 10 videos, but it didn`t work. xD
22 Replies
Jimmacle
Jimmacle13h ago
you can't convert a single C# file to an exe you need a C# project to build, and you'll probably want to publish it as $singlefile
MODiX
MODiX13h ago
dotnet publish -c Release -r <runtime identifier> -p:PublishSingleFile=true Use of -p:PublishSingleFile=true implies --self-contained true. Add --self-contained false to publish as runtime-dependent. -r RID and -p:PublishSingleFile=true can be moved to .csproj as the following properties:
<RuntimeIdentifier>RID</RuntimeIdentifier>
<PublishSingleFile>true</PublishSingleFile>
<RuntimeIdentifier>RID</RuntimeIdentifier>
<PublishSingleFile>true</PublishSingleFile>
but to target multiple RIDs, you have to use dotnet publish with the -r option for each RID. You can also add -p:IncludeNativeLibrariesForSelfExtract=true to include native libraries (like Common Language Runtime dlls) in the output executable, but be aware of drawbacks and consider using an installer framework instead of that property with PublishSingleFile. You might want to instead publish your application compiled Ahead Of Time to native code, see $nativeaot for examples. Single file publishing | Runtime Identifier (RID) catalog | dotnet publish
Jimmacle
Jimmacle13h ago
why do you need to compile a C# program when you have (i presume) no knowledge of C#?
Muckelodien
MuckelodienOP13h ago
I wanted to create a local ai and asked chat Gpt for a setup programm in c# :catHeyHello:
Jimmacle
Jimmacle13h ago
you're going to have very poor luck with that
Muckelodien
MuckelodienOP13h ago
can you do it?
Jimmacle
Jimmacle13h ago
i can, but i won't we don't give handouts here
Muckelodien
MuckelodienOP13h ago
why?
Jimmacle
Jimmacle13h ago
especially when it's AI generated slop and you haven't put any effort into learning yourself
Muckelodien
MuckelodienOP13h ago
I understood it but cant convert it
Jimmacle
Jimmacle13h ago
well, that's the most important part of the programming the compiling i recommend starting with $helloworld
Muckelodien
MuckelodienOP13h ago
why is it so complicated?
Jimmacle
Jimmacle13h ago
it's not
Muckelodien
MuckelodienOP13h ago
I only want to convert it in .exe
Jimmacle
Jimmacle13h ago
start with those links and you'll eventually get to a point where you can do that we can answer questions you have along the way
Muckelodien
MuckelodienOP13h ago
ok
Unknown User
Unknown User13h ago
Message Not Public
Sign In & Join Server To View
Keswiik
Keswiik12h ago
By "create a local ai", do you mean pulling down some random LLM and asking it questions? Or are you wanting to train / create something custom? Assuming the latter, it is going to be very difficult for you since: 1) ML stuff is complicated and very math heavy, if you do not know what you are doing then random YT tutorials are unlikely to help you 2) you don't know c# (i am going to assume you are a beginner to programming in general) If your goal is just to run a pre-existing language model, like llama, gemini, etc, and you have hardware capable of loading them.... take a look at LMStudio: https://lmstudio.ai/
LM Studio
LM Studio - Discover, download, and run local LLMs
Run Llama, Gemma 3, DeepSeek locally on your computer.
Jimmacle
Jimmacle12h ago
i've also used msty and it seemed decent but yeah, if your only goal is to run a LLM locally you don't need to write any code yourself
Keswiik
Keswiik12h ago
haven't heard of msty before, looks pretty comparable to lmstudio :PepoThink: nice to know
jcotton42
jcotton4212h ago
That is some truly awful code. Why is it using powershell at all :kek:

Did you find this page helpful?