C# Compiler Options

C# Compiler Options

————————–

DOS>CSC    /t:exe                            /out:Add.exe    a.cs[enter]

/t:winexe

/t:library

/t:module

Console Apps

——————-

csc  a.cs[enter]                                  => a.exe

csc  /out:Add.exe   a.cs[enter]                   => Add.exe

csc  /t:exe   /out:B.exe    a.cs[enter]        => B.exe

Windows/ Forms Apps

—————————

csc  /t:winexe    /out:MyForm.exe    b.cs[enter]                                 =>MyForm.exe

csc  /t:winexe    /out:MyForm.exe    a.cs  b.cs  c.cs[enter]              =>MyForm.exe

csc  /t:winexe    /out:MyForm.exe    Fldr\*.cs[enter]       =>MyForm.exe

Library Creation/ Component / .dll

—————————————–

csc  /t:library     a.cs[enter]                                           =>a.dll

csc  /t:library     /out:MyApp.dll    a.cs[enter]        =>MyApp.dll

csc  /t:library     /out:MyApp.dll    Fldr\*.cs[enter]              =>MyApp.dll

Module

——————-

Step – I

—————

Company-A

>csc  /t:module    /out:A.netmodule     FldrA\*.cs[enter]               =>A.netmodule

Company-B

>csc  /t:module    /out:B.netmodule     FldrB\*.cs[enter]                =>B.netmodule

Company-C

>csc  /t:module    /out:C.netmodule     FldrC\*.cs[enter]                =>C.netmodule

Step-II

————-

*.netmodule

csc   /t:library     /out:JointApp.dll     /addmodule:JointFldr\*.netmodule[enter]

——-

C# Compiler Options

—————————-

DOS>csc      /target:exe                 /out:NewName.exe                       a.cs[enter]

winexe

library                   /out:MyApp.dll                 *.cs[enter]

module

Console App      Main method

—————

csc   /t:exe    a.cs[enter]                                => a.exe

csc    a.cs                                                              =>a.exe

csc    /out:Add.exe            a.cs[enter]        =>Add.exe

Windows / Forms App   Main Method

————————-

csc  /t:winexe    /out:MyApp.exe     MyForm.cs[enter]

Library  .dll

——————-

csc  /t:library      a.cs[enter]          => a.dll

csc  /t:library   /out:MyApp.dll  a.cs[enter]  => MyApp.dll

csc  /t:library      /out:MyApp.dll

c:\B110\Controls\*.cs[enter]

=> MyApp.dll

csc  /t:library      /out:MyApp.dll

c:\B110\Controls\a.cs b.cs c.cs[enter]

=> MyApp.dll

 

Module

————–

Step – I

————

Company- A

csc  /t:module  /out:A.netmodule  A\*.cs[enter]

Company- B

csc  /t:module  /out:B.netmodule  B\*.cs[enter]

Company- C

csc  /t:module  /out:C.netmodule  C\*.cs[enter]

Step – II

———–

At Main Office:

A.netmodule, B.netmodule, C.netmodule

csc /t:library  /out:JointApp.dll

/addmodule:D\*.netmodule [enter]

———

Compile.bat

—————-

set path=%path%;D:\WINDOWS\Microsoft.NET\Framework\v3.5;

csc  /t:exe  /out:Add.exe  a.cs

With Argument:  //static int Main(string[] ar)

DOS>Add  22  33[enter]

 

Without Argument:  //static void Main()

DOS>Add[enter]

Add Two Number:

———————-

 

Enter First Number: 276[enter]

Enter Second Number:434[enter]

710

Sum of 276 and 434 is 710

DOS>

 

C# Compiler Options

————————–

csc.exe

DOS>csc    /target:exe             /out:New.exe          A.cs

/t:winexe

/t:library

/t:module

Console Applications

DOS>csc  a.cs[enter]     // a.exe

DOS>csc  /t:exe  a.cs[enter]     // a.exe

DOS>csc /out:MyCon.exe   a.cs[enter]     // MyCon.exe

 

Windows Applications

—-

DOS>csc /t:winexe  a.cs[enter]     // a.exe

DOS>csc /t:winexe  /out:MyForm.exe  a.cs[enter]     // MyForm.exe

Library // .dll

—–

DOS>csc  /t:library     a.cs[enter]       // a.dll

DOS>csc  /t:library     /out:MyApp.dll  a.cs[enter]       // MyApp.dll

DOS>csc  /t:library     /out:MyApp.dll  a.cs b.cs  c.cs[enter]       // MyApp.dll

DOS>csc  /t:library     /out:MyApp.dll  c:\B113\Controls\*.cs[enter]       // MyApp.dll

 

DOS>csc  /t:library     /out:C:\B113\Bin\MyApp.dll

c:\B113\Controls\*.cs[enter]

// MyApp.dll

 

Module

————-

Company A

—-

DOS>csc    /t:module   /out:A.netmodule   \FolderA\*.cs[enter]

Company B

—-

DOS>csc    /t:module   /out:B.netmodule   \FolderB\*.cs[enter]

Company C

—-

DOS>csc    /t:module   /out:C.netmodule   \FolderC\*.cs[enter]

Finally,

DOS>csc  /t:library   /out:JointApp.dll  /addmodule:C:\FolderN\*.netmodule[enter]

* C# Compiler Options

R K Gupta

Hi, This is R K Gupta, an IT professional and Entrepreneur. I have written many articles yet for my websites gsesoftsolutions.com, Hope you like it. Kindly subscribe our feed for any updates. Add me in Facebook and Google+

More Posts - Website

Follow Me:
TwitterFacebookPinterestYouTube

Hi, This is R K Gupta, an IT professional and Entrepreneur. I have written many articles yet for my websites gsesoftsolutions.com, Hope you like it. Kindly subscribe our feed for any updates. Add me in Facebook and Google+

Posted in Microsoft .Net Help, Software Development