convert c# to .exe
hey, can anyone convert this file to .exe? Iwatched 10 videos, but it didn`t work. xD
22 Replies
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
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: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
why do you need to compile a C# program when you have (i presume) no knowledge of C#?
I wanted to create a local ai and asked chat Gpt for a setup programm in c# :catHeyHello:
you're going to have very poor luck with that
can you do it?
i can, but i won't
we don't give handouts here
why?
especially when it's AI generated slop and you haven't put any effort into learning yourself
I understood it but cant convert it
well, that's the most important part of the programming
the compiling
i recommend starting with $helloworld
why is it so complicated?
it's not
I only want to convert it in .exe
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
ok
Unknown User•13h ago
Message Not Public
Sign In & Join Server To View
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.
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
haven't heard of msty before, looks pretty comparable to lmstudio :PepoThink: nice to know
That is some truly awful code.
Why is it using powershell at all :kek: