This course takes .NET developers behind the scenes of C# language features to gain a deeper understanding of the language, the Intermediate Language (IL) it compiles into, and the Common Language Runtime (CLR) it runs on. By studying language internals, you can make well-informed design choices, solve hard debugging puzzles quicker, and understand the performance ramifications of using various language features. This is the first part of a two-part course.
Bart is a software engineer building massive scale data processing systems at Microsoft. His areas of expertise include programming languages, runtimes, reactive
programming, and databases. Prior to joining Microsoft, Bart was an MVP for C#. Bart is a popular speaker at various conferences and the author of a few C# books.
C# Compiler Tidbits Hi everyone, and welcome back to the C# language internals course here at Pluralsight. I'm Bart De Smet, and in this module we'll talk about C# Compiler Tidbits. As we discussed in the very first module of this course, the C# compiler is called csc. exe, and it can be invoked at the command line or indirectly to Visual Studio and MSBuild. Now, as you may expect, the compiler can be configured in a variety of ways, so there are quite a few knobs that you can turn, and we'll talk those in quite some depth during this module. Now, in order to configure the compiler, you can either specify those knobs at the command line or you can configure them to Visual Studio, but you can also specify an. rsp file or a response file, and in fact the compiler's defaults are actually stored in a file called csc. rsp in the framework installation folder. Now, what are the different categories of compiler options that we can actually enable? Now, first of all there are a set of options that have to do with the specification of the output. So, you can configure whether you want to compile to an executable, a Windows object file for Windows metadata in the Windows Runtime, maybe DLL as a class library, and many other options. You can also specify the target platform, which we'll talk about in quite some depth. We can reference various assemblies including. NET framework assemblies themselves. We can specify various options that influence the code generation, and that will be the topic of discussion next where we'll talk about optimization. We can also configure language options so you can restrict what the compiler supports through a certain subset of the language. There are various security settings for things like strong naming, which we won't really talk about here, and finally a bunch of advanced options.