Hack Forums
[C#] cs to exe using comand prompt - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [C#] cs to exe using comand prompt (/showthread.php?tid=6186396)



cs to exe using comand prompt - altana - Dec 25, 2021

Hi, after searching to compile c# program whitout visual studio I found :

"C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe somefile.cs"

And it worked well, but after I found :

"C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild "C:\Projects\MyProject.csproj"
/p:Configuration=Debug;DeployOnBuild=True;PackageAsSingleFile=False;
outdir=C:\Projects\MyProjects\Publish\"

But it didn't worked, so I wanted to know if by any chance there is a possibility to combine and optain that :

"C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe somefile.cs /p:Configuration=Debug;"

Also I would like to add the parameter "output type" as a "Windows Application" wich is why I searched all of that for.

https :// zupimages.net/viewer.php?id=21/51/kdqb.png


RE: cs to exe using comand prompt - gigajew - Dec 26, 2021

Here you go this is the parameter documentation for the c compiler https://www.oreilly.com/library/view/net-framework-essentials/0596001657/apds06.html


RE: cs to exe using comand prompt - scriptsandapps - Feb 9, 2022

Basic example

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.exe /out:black-rocky.exe /target:winexe program.cs form1.cs Form1.Designer.cs

basic example:

github.com/ScriptsAndApps/Blackscreen.exe


you should also look to add .resources files

docs.microsoft.com/en-us/dotnet/core/extensions/create-resource-files