NET Framework Using C# (VS 2015)
Total Page:16
File Type:pdf, Size:1020Kb
.NET Framework Using C#® (VS 2015) This four-day course is designed to provide a sound introduction to the .NET Framework for programmers who already know the C# language and the fundamentals of Windows Forms. It is current to .NET 4.6 and Visual Studio 2015, which now includes support for cross-platform development. The course focuses on core portions of the .NET Framework that are common across many application areas. Separate courses are available in specific areas, such as ADO.NET, XML Programming, Windows Presentation Framework, Windows Communications Framework and ASP.NET. The course starts with an introduction to the architecture and key concepts of .NET. It then discusses class libraries, assemblies, versioning, configuration, and deployment, which constitute a major advance in the simplicity and robustness of deploying Windows applications, ending the notorious “DLL hell.” The next four chapters discuss important topics in the .NET programming model, including metadata, reflection, I/O, and serialization. Chapter 6 continues the discussion of the .NET programming model, covering memory management, asynchronous programming and application domains. .NET Security, which was simplified in .NET 4.0, is introduced, including both code access security and role-based security. The next chapter covers interoperability of .NET with COM and with Win32 applications. The course includes an introduction to database programming using ADO.NET and LINQ. Finally, the .NET Framework diagnostic facilities are discussed in depth. An appendix covers .NET Remoting. Audience: Experienced application developers or architects. Prerequisites: A working knowledge of C#, including building simple GUIs with Windows Forms. Number of Days: 4 days 1. .NET Fundamentals The Role of XML What Is Microsoft .NET? Performance Open Standards and Interoperability .NET Native Windows Development Problems .NET Core Common Language Runtime 2. Class Libraries Attribute-Based Programming Objects and Components Metadata Limitation of COM Components Types Components in .NET NET Framework Class Library Class Libraries at the Command Line Interface-Based Programming Monolithic versus Component Everything is an Object Class Libraries Using Visual Studio Common Type System References in Visual Studio ILDASM References at Compile Time and Run .NET Framework SDK Tools Time Language Interoperability Project Dependencies Managed Code Specifying Version Numbers Assemblies 3. Assemblies, Deployment and Assembly Deployment Configuration JIT Compilation Assemblies ASP.NET and Web Services Customer Management System © ITCourseware, LLC 1 .NET Framework Using C# (VS 2015) ILDASM Dispose Assembly Manifest Finalize/Dispose Test Program Assembly Dependency Metadata Garbage Collection Performance Assembly Metadata Generations Versioning an Assembly Processes AssemblyVersion Attribute Threads Strong Names Asynchronous Calls Digital Signatures Asynchronous Delegates Verification with Digital Signatures Using a CallBack Method Hash Codes BackgroundWorker Digitally Signing an Assembly Asynchronous Programs in C# 6.0 Digital Signing Flowchart Task and Task<TResult> Signing the Customer Assembly Async Methods Signed Assembly Metadata Synchronous Call Private Assembly Deployment Asyn Call Assembly Cache Threading Deploying a Shared Assembly Application Isolation Versioning Shared Components Application Domain How the CLR Locates Assemblies Application Domains and Assemblies Resolving an Assembly Reference AppDomain Version Policy in a Configuration File CreateDomain Finding the Assembly App Domain Events Application Settings 7. .NET Threading Application Settings Using Visual Threads Studio .NET Threading Model Application Configuration File Race Conditions User Configuration File Thread Synchronization 4. Metadata and Reflection Monitor Metadata Using C# lock Keyword Reflection Synchronization of Collections System.Reflection.Assembly ThreadPool Class System.Type Starting a ThreadPool Thread System.Reflection.MethodInfo Foreground and Background Threads Dynamic Invocation Synchronizing Threads Late Binding Task Parallel Library (TPL) 5. I/O and Serialization Starting Tasks Input and Output in .NET Waiting for Task Completion Directories Data Parallelism Files and Streams 8. .NET Security “Read” Command Fundamental Problem of Security Code for “Write” Command Authentication Serialization Authorization Attributes The Internet and .NET Security 6. .NET Programming Model Code Access Security Garbage Collection Role-Based Security Finalize Method .NET Security Concepts C# Destructor Notation Permissions © ITCourseware, LLC 2 .NET Framework Using C# (VS 2015) IPermission Interface .NET Namespaces IPermission Demand Method Connected Data Access IPermission Inheritance Hierarchy AcmePub Database Stack Walking Creating a Connection Assert SQL Express LocalDB Demand SqlLocalDB Utility Other CAS Methods Using Server Explorer Security Policy Simplification Performing Queries Simple Sandboxing API Connecting to a Database Setting Up Permissions Database Code Creating the Sandbox Connection String Role-Based Security in .NET Using Commands Identity Objects Creating a Command Object Principal Objects Using a Data Reader Windows Principal Information Generic Collections Custom Identity and Principal Executing Commands BasicIdentity.cs Parameterized Queries BasicSecurity.cs DataSet Users.cs DataSet Architecture Roles.cs Why DataSet? RoleDemo.cs DataSet Components PrincipalPermission DataAdapter 9. Interoperating with COM and Win32 Data Access Class Interoperating Between Managed and Retrieving the Data Unmanaged Code Filling a DataSet COM Interop and PInvoke Accessing a DataSet Calling COM Components from Using a Standalone Data Table Managed Code Adding a New Row The TlbImp.exe Utility Searching and Updating a Row TlbImp Syntax Deleting a Row Using TlbImp Row Versions Register the COM Server Row State OLE/COM Object Viewer Iterating Through DataRows 64-bit System Considerations Command Builders Run the COM Client Updating a Database Implement the .NET Client Program Data Binding The Client Target Platform is 32-bit DataGridView Control Import a Type Library Using Visual Language Integrated Query (LINQ) Studio LINQ to ADO.NET Platform Invocation Services (Pinvoke) Bridging Objects and Data Marshalling out Parameters Object Relational Designer Translating Types IntelliSense 10. ADO.NET and LINQ Basic LINQ Query Operators ADO.NET Obtaining a Data Source ADO.NET Architecture Filtering .NET Data Providers Ordering ADO.NET Interfaces Aggregation © ITCourseware, LLC 3 .NET Framework Using C# (VS 2015) Obtaining Lists and Arrays Using a Configuration File Deferred Execution TraceSwitch Modifying a Data Source Trace Listeners Performing Inserts via LINQ to SQL DefaultTraceListener Performing Deletes via LINQ to SQL A Stream Listener Performing Updates via LINQ to SQL A Custom Listener 11. Debugging Fundamentals Trace Output to a Window Compile-Time Errors An Event Log Listener Runtime Errors Tracing in the Order Application Debugging Trace Output Project Configurations Appendix A: .NET Remoting Release Configuration Distributed Programming in .NET Creating a New Configuration Windows Communication Foundation Build Settings for a Configuration .NET Remoting Architecture Customizing a Toolbar Remote Objects and Mobile Objects Using the Visual Studio Debugger Object Activation and Lifetime Overflow Exception Singleton and SingleCall Just-in-Time Debugging Appendix B: Learning Resources Attach to Running Process Standard Debugging – Breakpoints Standard Debugging – Watch Variables Stepping with the Debugger The Call Stack JIT Debugging in Windows Apps Configuration File Finding the Bug 12. Tracing Instrumenting an Application Order Application Debugging Review Tracing Debug and Trace Classes Viewing Trace Output Debug Statements Debug Output Assert More Debug Output WriteLine Syntax Event Logs Viewing Event Logs Event Log Entry Types .NET EventLog Component Retrieving Entries from an Event Log Handling EventLog Events 13. More about Tracing Trace Switches BooleanSwitch © ITCourseware, LLC 4 .NET Framework Using C# (VS 2015) .