✅ how to generate an executable from a csharp code
Hello, i'd want to generate an exe from a C# code, is it possible ? if yes can you help me ? thanks in advance. (without using dotnet cli or msbuild or even csc.exe)
36 Replies
"without using dotnet cli or msbuild or even csc.exe"
... why
those are literally the correct tools for this
basically I have a nodejs project that builds an exe and I cant use msbuild etc..
but I'm making a "builder" in C# with Mono.Csharp
but its not working either
thanks for trying to help me @jcotton42, i really appreciate it
Why can you use this tool but not the regular compiler?
wdym ?
Why are you using Mono.CSharp for this and not Roslyn or just command-line
dotnet
?Roslyn ?
what's that ?
The C# compiler, available as a C# library
bc if im not using the cli of dotnet
do u have a code example of it or nah?
So you want to transpile C#...?
wdym by "transpile" ?
this isnt making a lot of sense, what is your goal here?
generate an executable from a csharp code
right so where does nodejs come into it and why do you need to do that
That's literally just compiling
yh, its the same
The .NET Compiler Platform SDK (Roslyn APIs) - C#
Learn to use the .NET Compiler Platform SDK (also called the Roslyn APIs) to understand .NET code, spot errors, and fix those errors.
bc, nodejs uses a library to interpret the code like edge-js or nexe and its interpreting it do use the builder.exe, the builder.exe is the exe that'll compiles the new exe that got build
idk if u got my idea
idk really how to explain
and your builder is written in c#?
it says Compilation failed. Errors:
(8,21): error CS0103: Name 'Console' does not exist in current context
Oh you're already using Roslyn
yup
idk about the name "HelloWorld.exe" 💀 please dont judge me 🤣😂
but its not working
.
Yes because you're referencing the proper assemblies
hmm?
I still have no idea what you're trying to do, but you can ask in #roslyn if you have questions about Roslyn
okk
ty
done
but do u know how can i fix the code ?
looks like you're missing references to your Metadata
probably only had to add the System.Console but for safety
@Witchz
yep
ty i fixed it
but thnx for ur help man
no worries, dont forget to $close it
Use the /close command to mark a forum thread as answered
sorry