C
C#10mo ago
yushuv

✅ Compiling C# file individually

hi, it would be great if anyone could tell me a way to compile C# code directly from 'csc' compiler and I want to use the latest version of compiler. The old version works by: csc filename.cs The .NET now seem to have C# compiler stored as 'csc.dll' and I can't directly call it from terminal to compile my C# files. What could be the solution? I've been doing this....1st compiled the '.cs' file and executes the '.exe' file:
No description
No description
4 Replies
jcotton42
jcotton4210mo ago
you can do it with dotnet path/to/csc.dll, but there's a ton of parameters you'll need to pass Just make a project
Angius
Angius10mo ago
Compiling C# file individually
No There's no reason to
Lex Li
Lex Li10mo ago
First you might learn why you hit the old compiler(s), https://halfblood.pro/the-rough-history-of-the-so-many-c-compilers-f3a85500707c Then you might try to wrap up the individual C# file(s) in project(s), .csproj so that you can use MSBuild/.NET SDK to compile them. That's the common way to compile C# code, not calling csc directly.
Half-Blood Programmer
The Rough History of The So Many C# Compilers
A post that summarizes the rough history of the so many C# compilers and interesting stores behind them.
yushuv
yushuvOP10mo ago
Alright, I will go with the normal way of creating projects for C# code. Thank you everyone.
Want results from more Discord servers?
Add your server