From the course: C# Essential Training 1: Types and Control Flow

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Compiling C# to a library or executable

Compiling C# to a library or executable - C# Tutorial

From the course: C# Essential Training 1: Types and Control Flow

Compiling C# to a library or executable

- [Matt] We're going to be focused on writing C# in this course, but I first want to touch on using the compiler to get your code to a runnable state. We'll start here with this C# class file, we've got the Person class identified in this person.cs file. And I've also got a Command Prompt open. So, I'm in that same folder. If I do a dir, you can see there's my person.cs in there and I'm going to use the C# compiler, so csc, and I'll just pass that person.cs in, I'll tell it I want the output file to be called personlibrary.dll, and then I want to tell it the target, and so the target is library, and I'm telling the compiler build this into a library or a DLL, as opposed to an executable that could run. Compiler runs against that file and our parameters and we get an output. So, if we look there, we've got our personlibrary.dll down near the bottom. If I go back into that Ildasm, okay, and we can pop that open, and see there's our library, and we've got our Person class just like we…

Contents