Building Component Libraries by Using the C# Command-Line Compiler : Assembly « Development « ASP.NET Tutorial






The C# compiler is located at the following path:

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\csc.exe

The Visual Basic command-line compiler is located at the following path:

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\vbc.exe

You can use the csc.exe tool to compile any C# source file like this:

csc /t:library SomeFile.cs


The /t (target) option causes the compiler to create a component library and not a Console or Windows application. 
When you execute this command, a new file named SomeFile.dll is created, which is the compiled assembly.

To compiling a single file, you can compile all the source code files in a folder (and every subfolder) like this:

csc /t:library /recurse:*.cs /out:MyLibrary.dll

The /recurse option causes the compiler to compile the contents of all the subfolders. 
The /out option provides a name for the resulting assembly.








9.3.Assembly
9.3.1.Building Component Libraries by Using the C# Command-Line Compiler
9.3.2.Make an assembly available to an ASP.NET application
9.3.3.Adding an Assembly to the Global Assembly Cache
9.3.4.Building Basic Components
9.3.5.Components and Dynamic Compilation
9.3.6.Mixing Different Language Components in the App_Code Folder
9.3.7.Declaring Methods
9.3.8.Declaring Fields and Properties
9.3.9.Component with Property
9.3.10.Adding comments to a component.
9.3.11.Using ASP.NET Intrinsics in a Component
9.3.12.Load server side assembly