Book description
Dig deep and master the intricacies of the common language
runtime, C#, and .NET development. Led by programming expert
Jeffrey Richter, a longtime consultant to the Microsoft .NET team -
you’ll gain pragmatic insights for building robust, reliable,
and responsive apps and components.
Fully updated for .NET Framework 4.5 and Visual Studio 2012
Delivers a thorough grounding in the .NET Framework architecture, runtime environment, and other key topics, including asynchronous programming and the new Windows Runtime
Provides extensive code samples in Visual C# 2012
Features authoritative, pragmatic guidance on difficult development concepts such as generics and threading
Table of contents
- CLR via C#, Fourth Edition
- Dedication
- Foreword
- Introduction
-
I. CLR Basics
-
1. The CLR’s Execution Model
- Compiling Source Code into Managed Modules
- Combining Managed Modules into Assemblies
- Loading the Common Language Runtime
- Executing Your Assembly’s Code
- The Native Code Generator Tool: NGen.exe
- The Framework Class Library
- The Common Type System
- The Common Language Specification
- Interoperability with Unmanaged Code
- 2. Building, Packaging, Deploying, and Administering Applications and Types
-
3. Shared Assemblies and Strongly Named Assemblies
- Two Kinds of Assemblies, Two Kinds of Deployment
- Giving an Assembly a Strong Name
- The Global Assembly Cache
- Building an Assembly That References a Strongly Named Assembly
- Strongly Named Assemblies Are Tamper-Resistant
- Delayed Signing
- Privately Deploying Strongly Named Assemblies
- How the Runtime Resolves Type References
- Advanced Administrative Control (Configuration)
-
1. The CLR’s Execution Model
-
II. Designing Types
- 4. Type Fundamentals
- 5. Primitive, Reference, and Value Types
- 6. Type and Member Basics
- 7. Constants and Fields
- 8. Methods
- 9. Parameters
- 10. Properties
-
11. Events
-
Designing a Type That Exposes an Event
- Step #1: Define a type that will hold any additional information that should be sent to receivers of the event notification
- Step #2: Define the event member
- Step #3: Define a method responsible for raising the event to notify registered objects that the event has occurred
- Step #4: Define a method that translates the input into the desired event
- How the Compiler Implements an Event
- Designing a Type That Listens for an Event
- Explicitly Implementing an Event
-
Designing a Type That Exposes an Event
-
12. Generics
- Generics in the Framework Class Library
- Generics Infrastructure
- Generic Interfaces
- Generic Delegates
- Delegate and Interface Contra-variant and Covariant Generic Type Arguments
- Generic Methods
- Generics and Other Members
- Verifiability and Constraints
-
13. Interfaces
- Class and Interface Inheritance
- Defining an Interface
- Inheriting an Interface
- More About Calling Interface Methods
- Implicit and Explicit Interface Method Implementations (What’s Happening Behind the Scenes)
- Generic Interfaces
- Generics and Interface Constraints
- Implementing Multiple Interfaces That Have the Same Method Name and Signature
- Improving Compile-Time Type Safety with Explicit Interface Method Implementations
- Be Careful with Explicit Interface Method Implementations
- Design: Base Class or Interface?
-
III. Essential Types
- 14. Chars, Strings, and Working with Text
- 15. Enumerated Types and Bit Flags
- 16. Arrays
-
17. Delegates
- A First Look at Delegates
- Using Delegates to Call Back Static Methods
- Using Delegates to Call Back Instance Methods
- Demystifying Delegates
- Using Delegates to Call Back Many Methods (Chaining)
- Enough with the Delegate Definitions Already (Generic Delegates)
- C#’s Syntactical Sugar for Delegates
- Delegates and Reflection
-
18. Custom Attributes
- Using Custom Attributes
- Defining Your Own Attribute Class
- Attribute Constructor and Field/Property Data Types
- Detecting the Use of a Custom Attribute
- Matching Two Attribute Instances Against Each Other
- Detecting the Use of a Custom Attribute Without Creating Attribute-Derived Objects
- Conditional Attribute Classes
- 19. Nullable Value Types
-
IV. Core Facilities
-
20. Exceptions and State Management
- Defining “Exception”
- Exception-Handling Mechanics
- The System.Exception Class
- FCL-Defined Exception Classes
- Throwing an Exception
- Defining Your Own Exception Class
- Trading Reliability for Productivity
- Guidelines and Best Practices
- Unhandled Exceptions
- Debugging Exceptions
- Exception-Handling Performance Considerations
- Constrained Execution Regions (CERs)
- Code Contracts
- 21. The Managed Heap and Garbage Collection
- 22. CLR Hosting and AppDomains
- 23. Assembly Loading and Reflection
-
24. Runtime Serialization
- Serialization/Deserialization Quick Start
- Making a Type Serializable
- Controlling Serialization and Deserialization
- How Formatters Serialize Type Instances
- Controlling the Serialized/Deserialized Data
- Streaming Contexts
- Serializing a Type As a Different Type and Deserializing an Object As a Different Object
- Serialization Surrogates
- Overriding the Assembly and/or Type When Deserializing an Object
- 25. Interoperating with WinRT Components
-
20. Exceptions and State Management
-
V. Threading
- 26. Thread Basics
-
27. Compute-Bound Asynchronous Operations
- Introducing the CLR’s Thread Pool
- Performing a Simple Compute-Bound Operation
- Execution Contexts
- Cooperative Cancellation and Timeout
- Tasks
- Parallel’s Static For, ForEach, and Invoke Methods
- Parallel Language Integrated Query
- Performing a Periodic Compute-Bound Operation
- How the Thread Pool Manages Its Threads
-
28. I/O-Bound Asynchronous Operations
- How Windows Performs I/O Operations
- C#’s Asynchronous Functions
- How the Compiler Transforms an Async Function into a State Machine
- Async Function Extensibility
- Async Functions and Event Handlers
- Async Functions in the Framework Class Library
- Async Functions and Exception Handling
- Other Async Function Features
- Applications and Their Threading Models
- Implementing a Server Asynchronously
- Canceling I/O Operations
- Some I/O Operations Must Be Done Synchronously
- I/O Request Priorities
- 29. Primitive Thread Synchronization Constructs
- 30. Hybrid Thread Synchronization Constructs
- Index
- About the Author
- Copyright
Product information
- Title: CLR via C#, Fourth Edition
- Author(s):
- Release date: November 2012
- Publisher(s): Microsoft Press
- ISBN: 9780735668737
You might also like
book
C# 10 and .NET 6 – Modern Cross-Platform Development - Sixth Edition
Publisher’s Note: Microsoft will stop supporting .NET 6 from November 2024. The newer 8th edition of …
book
C# 12 and .NET 8 – Modern Cross-Platform Development Fundamentals - Eighth Edition
An accessible guide for beginner-to-intermediate programmers to the concepts, real-world applications, and latest features of C# …
book
C# 11 and .NET 7 – Modern Cross-Platform Development Fundamentals - Seventh Edition
Publisher’s Note: Microsoft will stop supporting .NET 7 from May 2024. The newer 8th edition of …
book
C# 12 in a Nutshell
When you have questions about C# 12 or .NET 8, this best-selling guide has the answers …