SlideShare une entreprise Scribd logo
1  sur  38
Core Development with the Microsoft .NET Framework 2.0 Foundation

Objectives


                In this session, you will learn to:
                 • Configure an assembly by using the Configuration,
                   Configuration Element, Configuration Section classes, and
                   configuration base types available in the .NET Framework 2.0
                 • Perform various installation tasks related to assembly
                   installation
                 • Describe what event logs are and how to manage them
                 • Manage application processes
                 • Monitor and customize application performance
                 • Debug applications by using Visual Studio 2005
                 • Trace applications by using .NET Framework 2.0




     Ver. 1.0                                                           Slide 1 of 38
Core Development with the Microsoft .NET Framework 2.0 Foundation

Configuring an Assembly by Using Configuration Types


                What are Configuration Files?
                • A configuration file is an XML file that contains specific
                  configuration settings for an application.
                • When you configure a configuration file for an application, it
                  eliminates the need to recompile the application every time a
                  setting changes.
                • Configuration files can be of the following types:
                      Web.config
                      App.config
                      Machine.config




     Ver. 1.0                                                             Slide 2 of 38
Core Development with the Microsoft .NET Framework 2.0 Foundation

Configuring an Assembly by Using Configuration Types (Contd.)


                Access and Manage Configuration Settings
                   You can access and manage the configuration settings of a
                   computer, an application, or resources by using the
                   Configuration class.
                   You need to use the ConfigurationManager class to read
                   the data from a configuration file into an object of the
                   Configuration class.




     Ver. 1.0                                                         Slide 3 of 38
Core Development with the Microsoft .NET Framework 2.0 Foundation

Configuring an Assembly by Using Configuration Types (Contd.)


                Manage Configuration Elements
                • A configuration element is an XML tag in a configuration file
                  that contains a string value, attributes, or other child elements.
                • Configuration elements can be programmatically managed by
                  using the following classes:
                       ConfigurationElement
                       ConfigurationElementCollection
                       ConfigurationElementProperty




     Ver. 1.0                                                               Slide 4 of 38
Core Development with the Microsoft .NET Framework 2.0 Foundation

Configuring an Assembly by Using Configuration Types (Contd.)


                Manage Sections in Configuration Files
                • The following configuration section classes can be used to
                  manage sections within the configuration files:
                      ConfigurationSection: Adds a custom section to the
                      configuration file.
                      ConfigurationSectionCollection: Reads all the
                      configuration sections in a configuration file.
                      ConfigurationSectionGroup: Represents a group of related
                      configuration sections in a configuration file.
                      ConfigurationSectionGroupCollection: Represents a
                      collection of ConfigurationSectionGroup objects.




     Ver. 1.0                                                           Slide 5 of 38
Core Development with the Microsoft .NET Framework 2.0 Foundation

Configuring an Assembly by Using Configuration Types (Contd.)


                Create a Custom Type to Validate Configuration Values
                • It is important that the configuration values in the configuration
                  file are valid in type as well as in range.
                • You can implement the following interfaces to
                  programmatically access application settings, specific sections
                  within a configuration file:
                       IConfigurationSectionHandler
                       ISettingsProviderService
                       IApplicationSettingsProvider




     Ver. 1.0                                                               Slide 6 of 38
Core Development with the Microsoft .NET Framework 2.0 Foundation

Performing Installation Tasks


                Configure the Run-time Version of .Net Framework
                   You need to configure the runtime version on the computer to
                   execute the applications created in the .NET Framework.
                   To define the runtime version, you can use the
                   supportedRuntime and compatibilityversion
                   elements in the configuration file of the corresponding
                   application.
                   Bootstrapping is the process of installing and configuring the
                   CLR by using various deployment tools.




     Ver. 1.0                                                             Slide 7 of 38
Core Development with the Microsoft .NET Framework 2.0 Foundation

Performing Installation Tasks (Contd.)


                Configure the Location, Version, and Search Path of an
                Assembly
                   You should configure the location and version of all the
                   assemblies you reference in your application so that the CLR is
                   able to locate the assemblies easily.
                   You can either use mscorcfg.msc or codebase and probing
                   element to configure assemblies.




     Ver. 1.0                                                             Slide 8 of 38
Core Development with the Microsoft .NET Framework 2.0 Foundation

Performing Installation Tasks (Contd.)


                Configuring an Application by Using Mscorcfg.msc
                   Mscocrfg.msc allows you to manage and configure assemblies
                   in the global assembly cache, adjust code access security
                   policy, and perform remoting services.
                   You can run this utility at the command prompt. You can also
                   access this utility from Start Menu, Control Panel,
                   Administrative Tools, Microsoft .NET Framework 2.0
                   Configuration.
                   You can configure applications using mscocrfg.msc under
                   administrator control.




     Ver. 1.0                                                          Slide 9 of 38
Core Development with the Microsoft .NET Framework 2.0 Foundation

Performing Installation Tasks (Contd.)


                Configure Concurrent Garbage Collection
                   Garbage collection is a feature provided by the .NET
                   Framework to automatically manage the allocation and release
                   of memory for the managed objects in an application.
                   Garbage collector can be configured in the following modes:
                      Concurrent mode: In this mode, the garbage collector runs in a
                      process space that is different from the default domain of the
                      assembly. As a result, the execution of assembly does not have to
                      pause for garbage collection.
                      Non-Concurrent mode: In this mode, garbage collection happens
                      on the same thread as the thread running user code.




     Ver. 1.0                                                                 Slide 10 of 38
Core Development with the Microsoft .NET Framework 2.0 Foundation

Performing Installation Tasks (Contd.)


                Register Remote Objects by Using Configuration Files
                   You can use the configuration files for registering remote
                   assemblies. This eliminates the need for recompiling the code.
                   The remote assemblies communicate with each other through
                   channels.
                   Channels are objects that transport messages between
                   applications across remoting boundaries.




     Ver. 1.0                                                            Slide 11 of 38
Core Development with the Microsoft .NET Framework 2.0 Foundation

Just a minute


                What is bootstrapping?




                Answer
                   The process of installing and configuring the CLR by using
                   deployment tools is called bootstrapping.



     Ver. 1.0                                                            Slide 12 of 38
Core Development with the Microsoft .NET Framework 2.0 Foundation

Managing an Event Log


                What are Event Logs?
                • Event logs are similar to a catalog where you can store entries
                  for particular activities and actions that occur within your
                  application.
                • Windows maintains the following types of event logs:
                    • System Event Log: Logs information that takes place on system
                      level hardware.
                    • Security Event Log: Logs security level events.
                    • Application Log: Contains events logged by applications or
                      programs.
                • Event logs can be viewed programmatically by using the
                  EventLog class.
                • EventLogPermission class allows you to specify code access
                  security permissions for event logs.



     Ver. 1.0                                                               Slide 13 of 38
Core Development with the Microsoft .NET Framework 2.0 Foundation

Managing an Event Log (Contd.)


                The following code example demonstrates the creation of a
                custom event log and a custom event source:
                class MyEventLog     {
                public static void Main() {
                  //Create the source, if it does not already
                exist.
                if (!EventLog.SourceExists("MySource")) {
                EventLog.CreateEventSource("MySource","MyNewLog");
                Console.WriteLine("CreatingEventSource"); }
                  //Create an EventLog instance and assign its
                source.
                    EventLog myLog = new EventLog();
                    myLog.Source = "MySource";
                    myLog.WriteEntry("Writing to event log.");
                         }   }
     Ver. 1.0                                                     Slide 14 of 38
Core Development with the Microsoft .NET Framework 2.0 Foundation

Managing an Event Log (Contd.)


                How Entries Are Read and Written in an Event Log?
                   The EventLog class can be used to read and write entries in
                   existing logs.
                   The properties of the EventLog class are:
                      Log
                      MachineName
                      Entries
                      Source
                      WriteEvent
                      WriteEntry




     Ver. 1.0                                                          Slide 15 of 38
Core Development with the Microsoft .NET Framework 2.0 Foundation

Just a minute


                How do you write to an event log?




                Answer
                   The EventLog class provides properties Source, WriteEvent,
                   and WriteEntry that are used to write entries to an existing event
                   log.


     Ver. 1.0                                                              Slide 16 of 38
Core Development with the Microsoft .NET Framework 2.0 Foundation

Working with Application Processes


                How a List of All Running Processes Is Retrieved?
                • The GetProcesses method of the Process class is used to
                  retrieve the list of all the processes running on the computer.
                • It returns an array that lists all the running processes.
                How Information About the Current Process Is Retrieved?
                   The GetCurrentProcess method of the Process class is
                   used to retrieve information about the current process.
                How a List of All Modules Used by a Process Is Retrieved?
                   The Process class provides the Modules method that can be
                   used to retrieve a list of all the modules used by a process.




     Ver. 1.0                                                             Slide 17 of 38
Core Development with the Microsoft .NET Framework 2.0 Foundation

Working with Application Processes (Contd.)


                How an Application Process Is Started and Stopped?
                   The Start method is used to start a process.
                   The Kill method stops the specified process immediately. It
                   releases the resources allocated to the process.




     Ver. 1.0                                                          Slide 18 of 38
Core Development with the Microsoft .NET Framework 2.0 Foundation

Managing Application Performance


                Monitoring Application Performance by Using the
                Performance Monitor
                   In Windows 2000 and Windows XP, the Performance Monitor
                   is used to examine the performance of your applications.
                   The System Monitor in the Performance Monitor is used to
                   monitor the execution of processes.
                   Each monitored resource in the Performance Monitor is called
                   a performance object.
                   Each performance object has certain performance counters
                   associated with it.




     Ver. 1.0                                                           Slide 19 of 38
Core Development with the Microsoft .NET Framework 2.0 Foundation

Managing Application Performance (Contd.)


                How Performance Information Is Customized by Using
                Performance Counter Classes?
                   The System.Diagnostics namespace provides several
                   classes that can be used to create custom performance
                   counters.
                   The important classes are:
                      PerformanceCounter: Evaluates feedback from existing
                      counters.
                      PerformanceCounterCategory: Creates or removes custom
                      categories.
                      CounterCreationData: Creates multiple counters in a category
                      and specifies their types.




     Ver. 1.0                                                            Slide 20 of 38
Core Development with the Microsoft .NET Framework 2.0 Foundation

Debugging Applications


                What is Debugging?
                • The process of finding and correcting the defects in a block of
                  code is called debugging.
                • Debugging helps you resolve several kinds of errors. These
                  errors can be divided into the following types:
                    • Syntax error
                    • Run-time error
                    • Logic error
                • The Microsoft CLR Debugger is run to debug an application.
                • The Microsoft CLR Debugger is installed when you install
                  Visual Studio 2005.
                • It is part of the Visual Studio 2005 Software Development Kit
                  (SDK).




     Ver. 1.0                                                             Slide 21 of 38
Core Development with the Microsoft .NET Framework 2.0 Foundation

Debugging Applications (Contd.)


                How the Debugger Class Is Used to Debug
                Programmatically?
                   The .NET Framework provides the Debugger class, which
                   helps to launch the Visual Studio 2005 debugger
                   programmatically.
                   The primary methods associated with the Debugger class:
                      Break: This method signals a breakpoint to an attached
                      debugger, with a user breakpoint event.
                      Launch: This method launches a debugger and attaches it to the
                      process.
                      Log: This method posts a message for the attached debugger.




     Ver. 1.0                                                               Slide 22 of 38
Core Development with the Microsoft .NET Framework 2.0 Foundation

Debugging Applications (Contd.)


                The following code sample shows the implementation of the
                Debugger class:
                private void BreakInCode()
                {
                  BooleanSwitch assertSwitch = new
                  BooleanSwitch("BreakOnAssert", "");
                    if (assertSwitch.Enabled)
                    {
                        if (Debugger.IsAttached)
                        Debugger.Break();
                        else
                        Debugger.Launch();
                    }
                }

     Ver. 1.0                                                     Slide 23 of 38
Core Development with the Microsoft .NET Framework 2.0 Foundation

Debugging Applications (Contd.)


                How the Debug Class Is Used to Debug Programmatically?
                   The Debug class provides a set of methods and properties that
                   help in debugging code.
                   Methods in the Debug class can be used to print debug
                   information.
                   A few primary methods associated with the Debug class:
                      Assert: This method checks a condition. If the condition is false,
                      the method displays a message.
                      WriteLine: This method writes information about the debug to
                      the trace listeners in the Listeners collection.
                      WriteLineIf: This method checks a condition, and if the
                      condition holds true, the method writes information about the
                      debug to the trace listeners in the Listeners collection.




     Ver. 1.0                                                                  Slide 24 of 38
Core Development with the Microsoft .NET Framework 2.0 Foundation

Debugging Applications (Contd.)


                How User-Defined Types Are Configured by Using
                Debugger Attributes?
                   The Debugger attributes are a set of classes that can be used
                   to configure user-defined types in a debugger.
                How Call Stacks Are Managed by Using the StackFrame
                and StackTrace Classes?
                   StackFrame Class: Provides information about a stack frame.
                   A stack frame is the physical representation of a function call
                   on the call stack for the current thread.
                   The members of the StackFrame class are:
                      GetFileName method: This method is used to retrieve the name
                      of the file that has provided the code in execution.
                      GetFileLineNumber method: This method is used to retrieve
                      the line number in the file that contains the code currently in
                      execution.


     Ver. 1.0                                                                Slide 25 of 38
Core Development with the Microsoft .NET Framework 2.0 Foundation

Just a minute


                What are the different kinds of errors?




                Answer
                   The different kinds of errors are syntax errors, runtime errors,
                   and logic errors.



     Ver. 1.0                                                               Slide 26 of 38
Core Development with the Microsoft .NET Framework 2.0 Foundation

Tracing Applications


                •   What Is Application Tracing?
                       Application tracing refers to monitoring an application and
                       recording information about events as they occur in the
                       application.
                       Trace commands such as Trace.Write,
                       Trace.TraceInformation, Trace.TraceError, Trace.Indent, and
                       Trace.Assert enable a user to trace an application.
                       The .NET Framework provides the System.Web.TraceContext
                       class for a Web environment.
                       For a Windows environment, the .NET Framework provides the
                       System.Diagnostics.Trace and System.Diagnostics.Debug
                       classes.




     Ver. 1.0                                                             Slide 27 of 38
Core Development with the Microsoft .NET Framework 2.0 Foundation

Tracing Applications (Contd.)


                •   How Applications Are Traced Programmatically by Using
                    the Trace Class?
                       The Trace class provides a set of methods and properties that
                       help you to trace applications programmatically.
                       The members of the Trace class are:
                          Assert
                          WriteIf
                          Fail
                          Write
                          WriteLine
                          WriteLineIf
                       With the help of a configuration file, you can use the Trace
                       class programmatically in a console application to implement
                       tracing.



     Ver. 1.0                                                                Slide 28 of 38
Core Development with the Microsoft .NET Framework 2.0 Foundation

Tracing Applications (Contd.)


                •   How the Source of Tracing Is Identified by Using the
                    TraceSource Class?
                       The .NET Framework provides the TraceSource class that
                       helps to trace the execution of code and associate trace
                       messages with their source.
                       The members of the TraceSource class are:
                           TraceEvent
                           TraceData
                           TraceInformation
                           Name
                           Switch
                           Listeners
                       With the help of a configuration file, you can configure and
                       implement the TraceSource class.



     Ver. 1.0                                                                  Slide 29 of 38
Core Development with the Microsoft .NET Framework 2.0 Foundation

Tracing Applications (Contd.)


                You can also implement the TraceSource class by using C#
                to trace an application and associate trace messages with
                their source.
                The following code sample shows the implementation of the
                TraceSource class:
                using System;
                using System.Diagnostics;
                class Tracetest {
                   static TraceSource tS = new
                   TraceSource("TraceTest");
                   static void Main(string[] args)
                   {        tS.Listeners["console"].TraceOutputOp
                   tions |=             TraceOptions.Callstack;
                   tS.TraceEvent(TraceEventType.Warning, 1);
                 } }
     Ver. 1.0                                                     Slide 30 of 38
Core Development with the Microsoft .NET Framework 2.0 Foundation

Tracing Applications (Contd.)


                •   How the Tracing Output Is Configured by Using Trace
                    Switch Classes?
                       The trace switches are used to activate, deactivate, and filter
                       the tracing output.
                       The two types of trace switch classes are:
                           TraceSwitch
                           BooleanSwitch
                       The configuration file is used to add a switch and define its
                       value, remove a switch, or get rid of all switches set up initially
                       by the application.




     Ver. 1.0                                                                     Slide 31 of 38
Core Development with the Microsoft .NET Framework 2.0 Foundation

Tracing Applications (Contd.)


                The following code sample shows the implementation of the
                TraceSwitch class.
                using System;
                using System.Diagnostics;
                class Tracetest
                {
                    // Create a TraceSwitch to use in the entire
                    application class level declaration
                  private static TraceSwitch appSwitch = new
                     TraceSwitch("mySwitch", "Switch in config
                    file");




     Ver. 1.0                                                     Slide 32 of 38
Core Development with the Microsoft .NET Framework 2.0 Foundation

Tracing Applications (Contd.)


                public static void Main(string[] args)
                {
                Console.WriteLine("Trace switch {0} configured
                   as {1}",
                appSwitch.DisplayName,appSwitch.Level.ToString()
                   );
                if (appSwitch.TraceError)
                    {
                    //...
                    }
                  }
                }




     Ver. 1.0                                             Slide 33 of 38
Core Development with the Microsoft .NET Framework 2.0 Foundation

Tracing Applications (Contd.)


                •   How the Tracing Output Is Directed by Using Trace Listener
                    Classes?
                       Trace listeners are objects used to send the trace information
                       to an output location, such as a file, a printer, or the Visual
                       Studio 2005 output window.
                       The various trace listener classes are:
                           TraceListener
                           XmlWriterTraceListener
                           DelimitedListTraceListener
                           EventLogTraceListener
                       The TraceFilter class allows you to filter trace information
                       before sending it to an output location.
                       With the help of a configuration file, you can configure and
                       implement the TraceListener class.



     Ver. 1.0                                                                  Slide 34 of 38
Core Development with the Microsoft .NET Framework 2.0 Foundation

Tracing Applications (Contd.)


                •   How Trace Information Is Categorized by Using the
                    CorrelationManager Class?
                       The CorrelationManager class is used to group and
                       classify trace information for later analysis.
                       It is connected with the Thread class by the
                       CorrelationManager property.
                       The namespace for the CorrelationManager class is
                       System.Diagnostics, and the assembly is System (in
                       System.dll).




     Ver. 1.0                                                           Slide 35 of 38
Core Development with the Microsoft .NET Framework 2.0 Foundation

Just a minute


                What is the TraceSource class?




                Answer
                   The TraceSource class belongs to the System.Diagnostics
                   namespace and is used to trace the execution of code and
                   associate trace messages with their source.


     Ver. 1.0                                                          Slide 36 of 38
Core Development with the Microsoft .NET Framework 2.0 Foundation

Summary


                •   In this session, you learned that:
                       The application configuration file helps specify configuration
                       settings for applications other than Web applications.
                       mscorcfg.msc is a .NET Framework utility that helps configure
                       an application so that the application can use the externally
                       referenced assemblies.
                       Garbage collection is a feature provided by the .NET
                       Framework to automatically manage the allocation and release
                       of memory for the managed objects in an application.
                       Event logs contain entries to record important software and
                       hardware events.
                       An instance of an application under execution is called a
                       process.
                       You need to manage the performance of your application to
                       identify operational issues and optimize performance.


     Ver. 1.0                                                                Slide 37 of 38
Core Development with the Microsoft .NET Framework 2.0 Foundation

Summary (Contd.)


                Debugging helps you ensure that the code provides expected
                results.
                You can use tracing to monitor the code and the target points
                where an application deviates from the normal functioning.




     Ver. 1.0                                                         Slide 38 of 38

Contenu connexe

Tendances

Intel vmcs-shadowing-paper
Intel vmcs-shadowing-paperIntel vmcs-shadowing-paper
Intel vmcs-shadowing-paperAhmed Sallam
 
Jtag Tools For Linux
Jtag Tools For LinuxJtag Tools For Linux
Jtag Tools For Linuxsheilamia
 
UVM BASED REUSABLE VERIFICATION IP FOR WISHBONE COMPLIANT SPI MASTER CORE
UVM BASED REUSABLE VERIFICATION IP FOR WISHBONE COMPLIANT SPI MASTER COREUVM BASED REUSABLE VERIFICATION IP FOR WISHBONE COMPLIANT SPI MASTER CORE
UVM BASED REUSABLE VERIFICATION IP FOR WISHBONE COMPLIANT SPI MASTER COREVLSICS Design
 
Component Level Security
Component Level SecurityComponent Level Security
Component Level Securitysdevillers
 
24 23 jun17 2may17 16231 ijeecs latest_version (1) edit septian
24 23 jun17 2may17 16231 ijeecs latest_version (1) edit septian24 23 jun17 2may17 16231 ijeecs latest_version (1) edit septian
24 23 jun17 2may17 16231 ijeecs latest_version (1) edit septianIAESIJEECS
 
Comp tia a+_session_11
Comp tia a+_session_11Comp tia a+_session_11
Comp tia a+_session_11Niit Care
 
Java session11
Java session11Java session11
Java session11Niit Care
 
Alm 4 Azure with screenshots
Alm 4 Azure with screenshotsAlm 4 Azure with screenshots
Alm 4 Azure with screenshotsClemens Reijnen
 
"Docker best practice", Станислав Коленкин (senior devops, DataArt)
"Docker best practice", Станислав Коленкин (senior devops, DataArt)"Docker best practice", Станислав Коленкин (senior devops, DataArt)
"Docker best practice", Станислав Коленкин (senior devops, DataArt)DataArt
 

Tendances (11)

Intel vmcs-shadowing-paper
Intel vmcs-shadowing-paperIntel vmcs-shadowing-paper
Intel vmcs-shadowing-paper
 
Jtag Tools For Linux
Jtag Tools For LinuxJtag Tools For Linux
Jtag Tools For Linux
 
UVM BASED REUSABLE VERIFICATION IP FOR WISHBONE COMPLIANT SPI MASTER CORE
UVM BASED REUSABLE VERIFICATION IP FOR WISHBONE COMPLIANT SPI MASTER COREUVM BASED REUSABLE VERIFICATION IP FOR WISHBONE COMPLIANT SPI MASTER CORE
UVM BASED REUSABLE VERIFICATION IP FOR WISHBONE COMPLIANT SPI MASTER CORE
 
Component Level Security
Component Level SecurityComponent Level Security
Component Level Security
 
08 gui 11
08 gui 1108 gui 11
08 gui 11
 
Bright Computing - Bright Cluster Manager
Bright Computing - Bright Cluster ManagerBright Computing - Bright Cluster Manager
Bright Computing - Bright Cluster Manager
 
24 23 jun17 2may17 16231 ijeecs latest_version (1) edit septian
24 23 jun17 2may17 16231 ijeecs latest_version (1) edit septian24 23 jun17 2may17 16231 ijeecs latest_version (1) edit septian
24 23 jun17 2may17 16231 ijeecs latest_version (1) edit septian
 
Comp tia a+_session_11
Comp tia a+_session_11Comp tia a+_session_11
Comp tia a+_session_11
 
Java session11
Java session11Java session11
Java session11
 
Alm 4 Azure with screenshots
Alm 4 Azure with screenshotsAlm 4 Azure with screenshots
Alm 4 Azure with screenshots
 
"Docker best practice", Станислав Коленкин (senior devops, DataArt)
"Docker best practice", Станислав Коленкин (senior devops, DataArt)"Docker best practice", Станислав Коленкин (senior devops, DataArt)
"Docker best practice", Станислав Коленкин (senior devops, DataArt)
 

En vedette

15 asp.net session22
15 asp.net session2215 asp.net session22
15 asp.net session22Niit Care
 
Xml session02
Xml session02Xml session02
Xml session02Niit Care
 
Xml session07
Xml session07Xml session07
Xml session07Niit Care
 
Deawsj 7 ppt-1_c
Deawsj 7 ppt-1_cDeawsj 7 ppt-1_c
Deawsj 7 ppt-1_cNiit Care
 
Xml session05
Xml session05Xml session05
Xml session05Niit Care
 
15 ooad uml-20
15 ooad uml-2015 ooad uml-20
15 ooad uml-20Niit Care
 

En vedette (8)

15 asp.net session22
15 asp.net session2215 asp.net session22
15 asp.net session22
 
Xml session02
Xml session02Xml session02
Xml session02
 
Xml session07
Xml session07Xml session07
Xml session07
 
Deawsj 7 ppt-1_c
Deawsj 7 ppt-1_cDeawsj 7 ppt-1_c
Deawsj 7 ppt-1_c
 
Xml session05
Xml session05Xml session05
Xml session05
 
15 ooad uml-20
15 ooad uml-2015 ooad uml-20
15 ooad uml-20
 
Ajs 4 b
Ajs 4 bAjs 4 b
Ajs 4 b
 
Ajs 1 b
Ajs 1 bAjs 1 b
Ajs 1 b
 

Similaire à Net framework session03

Net framework session03
Net framework session03Net framework session03
Net framework session03Vivek chan
 
04 iec t1_s1_oo_ps_session_05
04 iec t1_s1_oo_ps_session_0504 iec t1_s1_oo_ps_session_05
04 iec t1_s1_oo_ps_session_05Niit Care
 
.NET TECHNOLOGIES
.NET TECHNOLOGIES.NET TECHNOLOGIES
.NET TECHNOLOGIESProf Ansari
 
.Net platform an understanding
.Net platform an understanding.Net platform an understanding
.Net platform an understandingBinu Bhasuran
 
An isas presentation on .net framework 2.0 by vikash chandra das
An isas presentation on .net framework 2.0 by vikash chandra dasAn isas presentation on .net framework 2.0 by vikash chandra das
An isas presentation on .net framework 2.0 by vikash chandra dasVikash Chandra Das
 
THE CLR AND THE .NET FRAMEWORK, C#
THE CLR AND THE .NET FRAMEWORK, C#THE CLR AND THE .NET FRAMEWORK, C#
THE CLR AND THE .NET FRAMEWORK, C#MANOJ BURI
 
.Net framework interview questions
.Net framework interview questions.Net framework interview questions
.Net framework interview questionsMir Majid
 
Online lg prodect
Online lg prodectOnline lg prodect
Online lg prodectYesu Raj
 
Secrets of .NET Assemblies and Memory Management
Secrets of .NET Assemblies and Memory ManagementSecrets of .NET Assemblies and Memory Management
Secrets of .NET Assemblies and Memory ManagementAbhishek Sur
 
Inside .net framework
Inside .net frameworkInside .net framework
Inside .net frameworkFaisal Aziz
 
Talk on .NET assemblies
Talk on .NET assembliesTalk on .NET assemblies
Talk on .NET assembliesVidya Agarwal
 
Enterprise Library 2.0 Core Architecture
Enterprise Library 2.0 Core ArchitectureEnterprise Library 2.0 Core Architecture
Enterprise Library 2.0 Core Architecturemcgurk
 
.Net framework
.Net framework.Net framework
.Net frameworkRaghu nath
 
Net framework session01
Net framework session01Net framework session01
Net framework session01Niit Care
 

Similaire à Net framework session03 (20)

Net framework session03
Net framework session03Net framework session03
Net framework session03
 
04 iec t1_s1_oo_ps_session_05
04 iec t1_s1_oo_ps_session_0504 iec t1_s1_oo_ps_session_05
04 iec t1_s1_oo_ps_session_05
 
About .net
About .net About .net
About .net
 
.NET TECHNOLOGIES
.NET TECHNOLOGIES.NET TECHNOLOGIES
.NET TECHNOLOGIES
 
.Net platform an understanding
.Net platform an understanding.Net platform an understanding
.Net platform an understanding
 
.Net framework
.Net framework.Net framework
.Net framework
 
An isas presentation on .net framework 2.0 by vikash chandra das
An isas presentation on .net framework 2.0 by vikash chandra dasAn isas presentation on .net framework 2.0 by vikash chandra das
An isas presentation on .net framework 2.0 by vikash chandra das
 
THE CLR AND THE .NET FRAMEWORK, C#
THE CLR AND THE .NET FRAMEWORK, C#THE CLR AND THE .NET FRAMEWORK, C#
THE CLR AND THE .NET FRAMEWORK, C#
 
.Net framework interview questions
.Net framework interview questions.Net framework interview questions
.Net framework interview questions
 
Online lg prodect
Online lg prodectOnline lg prodect
Online lg prodect
 
Secrets of .NET Assemblies and Memory Management
Secrets of .NET Assemblies and Memory ManagementSecrets of .NET Assemblies and Memory Management
Secrets of .NET Assemblies and Memory Management
 
Inside .net framework
Inside .net frameworkInside .net framework
Inside .net framework
 
.Net slid
.Net slid.Net slid
.Net slid
 
Talk on .NET assemblies
Talk on .NET assembliesTalk on .NET assemblies
Talk on .NET assemblies
 
Kushal
KushalKushal
Kushal
 
Enterprise Library 2.0 Core Architecture
Enterprise Library 2.0 Core ArchitectureEnterprise Library 2.0 Core Architecture
Enterprise Library 2.0 Core Architecture
 
.Net framework
.Net framework.Net framework
.Net framework
 
Net framework session01
Net framework session01Net framework session01
Net framework session01
 
Dot net introduction
Dot net introductionDot net introduction
Dot net introduction
 
.Net Session Overview
.Net Session Overview.Net Session Overview
.Net Session Overview
 

Plus de Niit Care (20)

Ajs 4 a
Ajs 4 aAjs 4 a
Ajs 4 a
 
Ajs 4 c
Ajs 4 cAjs 4 c
Ajs 4 c
 
Ajs 3 b
Ajs 3 bAjs 3 b
Ajs 3 b
 
Ajs 3 a
Ajs 3 aAjs 3 a
Ajs 3 a
 
Ajs 3 c
Ajs 3 cAjs 3 c
Ajs 3 c
 
Ajs 2 b
Ajs 2 bAjs 2 b
Ajs 2 b
 
Ajs 2 a
Ajs 2 aAjs 2 a
Ajs 2 a
 
Ajs 2 c
Ajs 2 cAjs 2 c
Ajs 2 c
 
Ajs 1 a
Ajs 1 aAjs 1 a
Ajs 1 a
 
Ajs 1 c
Ajs 1 cAjs 1 c
Ajs 1 c
 
Dacj 4 2-c
Dacj 4 2-cDacj 4 2-c
Dacj 4 2-c
 
Dacj 4 2-b
Dacj 4 2-bDacj 4 2-b
Dacj 4 2-b
 
Dacj 4 2-a
Dacj 4 2-aDacj 4 2-a
Dacj 4 2-a
 
Dacj 4 1-c
Dacj 4 1-cDacj 4 1-c
Dacj 4 1-c
 
Dacj 4 1-b
Dacj 4 1-bDacj 4 1-b
Dacj 4 1-b
 
Dacj 4 1-a
Dacj 4 1-aDacj 4 1-a
Dacj 4 1-a
 
Dacj 1-2 b
Dacj 1-2 bDacj 1-2 b
Dacj 1-2 b
 
Dacj 1-3 c
Dacj 1-3 cDacj 1-3 c
Dacj 1-3 c
 
Dacj 1-3 b
Dacj 1-3 bDacj 1-3 b
Dacj 1-3 b
 
Dacj 1-3 a
Dacj 1-3 aDacj 1-3 a
Dacj 1-3 a
 

Dernier

Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????blackmambaettijean
 

Dernier (20)

Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????
 

Net framework session03

  • 1. Core Development with the Microsoft .NET Framework 2.0 Foundation Objectives In this session, you will learn to: • Configure an assembly by using the Configuration, Configuration Element, Configuration Section classes, and configuration base types available in the .NET Framework 2.0 • Perform various installation tasks related to assembly installation • Describe what event logs are and how to manage them • Manage application processes • Monitor and customize application performance • Debug applications by using Visual Studio 2005 • Trace applications by using .NET Framework 2.0 Ver. 1.0 Slide 1 of 38
  • 2. Core Development with the Microsoft .NET Framework 2.0 Foundation Configuring an Assembly by Using Configuration Types What are Configuration Files? • A configuration file is an XML file that contains specific configuration settings for an application. • When you configure a configuration file for an application, it eliminates the need to recompile the application every time a setting changes. • Configuration files can be of the following types: Web.config App.config Machine.config Ver. 1.0 Slide 2 of 38
  • 3. Core Development with the Microsoft .NET Framework 2.0 Foundation Configuring an Assembly by Using Configuration Types (Contd.) Access and Manage Configuration Settings You can access and manage the configuration settings of a computer, an application, or resources by using the Configuration class. You need to use the ConfigurationManager class to read the data from a configuration file into an object of the Configuration class. Ver. 1.0 Slide 3 of 38
  • 4. Core Development with the Microsoft .NET Framework 2.0 Foundation Configuring an Assembly by Using Configuration Types (Contd.) Manage Configuration Elements • A configuration element is an XML tag in a configuration file that contains a string value, attributes, or other child elements. • Configuration elements can be programmatically managed by using the following classes: ConfigurationElement ConfigurationElementCollection ConfigurationElementProperty Ver. 1.0 Slide 4 of 38
  • 5. Core Development with the Microsoft .NET Framework 2.0 Foundation Configuring an Assembly by Using Configuration Types (Contd.) Manage Sections in Configuration Files • The following configuration section classes can be used to manage sections within the configuration files: ConfigurationSection: Adds a custom section to the configuration file. ConfigurationSectionCollection: Reads all the configuration sections in a configuration file. ConfigurationSectionGroup: Represents a group of related configuration sections in a configuration file. ConfigurationSectionGroupCollection: Represents a collection of ConfigurationSectionGroup objects. Ver. 1.0 Slide 5 of 38
  • 6. Core Development with the Microsoft .NET Framework 2.0 Foundation Configuring an Assembly by Using Configuration Types (Contd.) Create a Custom Type to Validate Configuration Values • It is important that the configuration values in the configuration file are valid in type as well as in range. • You can implement the following interfaces to programmatically access application settings, specific sections within a configuration file: IConfigurationSectionHandler ISettingsProviderService IApplicationSettingsProvider Ver. 1.0 Slide 6 of 38
  • 7. Core Development with the Microsoft .NET Framework 2.0 Foundation Performing Installation Tasks Configure the Run-time Version of .Net Framework You need to configure the runtime version on the computer to execute the applications created in the .NET Framework. To define the runtime version, you can use the supportedRuntime and compatibilityversion elements in the configuration file of the corresponding application. Bootstrapping is the process of installing and configuring the CLR by using various deployment tools. Ver. 1.0 Slide 7 of 38
  • 8. Core Development with the Microsoft .NET Framework 2.0 Foundation Performing Installation Tasks (Contd.) Configure the Location, Version, and Search Path of an Assembly You should configure the location and version of all the assemblies you reference in your application so that the CLR is able to locate the assemblies easily. You can either use mscorcfg.msc or codebase and probing element to configure assemblies. Ver. 1.0 Slide 8 of 38
  • 9. Core Development with the Microsoft .NET Framework 2.0 Foundation Performing Installation Tasks (Contd.) Configuring an Application by Using Mscorcfg.msc Mscocrfg.msc allows you to manage and configure assemblies in the global assembly cache, adjust code access security policy, and perform remoting services. You can run this utility at the command prompt. You can also access this utility from Start Menu, Control Panel, Administrative Tools, Microsoft .NET Framework 2.0 Configuration. You can configure applications using mscocrfg.msc under administrator control. Ver. 1.0 Slide 9 of 38
  • 10. Core Development with the Microsoft .NET Framework 2.0 Foundation Performing Installation Tasks (Contd.) Configure Concurrent Garbage Collection Garbage collection is a feature provided by the .NET Framework to automatically manage the allocation and release of memory for the managed objects in an application. Garbage collector can be configured in the following modes: Concurrent mode: In this mode, the garbage collector runs in a process space that is different from the default domain of the assembly. As a result, the execution of assembly does not have to pause for garbage collection. Non-Concurrent mode: In this mode, garbage collection happens on the same thread as the thread running user code. Ver. 1.0 Slide 10 of 38
  • 11. Core Development with the Microsoft .NET Framework 2.0 Foundation Performing Installation Tasks (Contd.) Register Remote Objects by Using Configuration Files You can use the configuration files for registering remote assemblies. This eliminates the need for recompiling the code. The remote assemblies communicate with each other through channels. Channels are objects that transport messages between applications across remoting boundaries. Ver. 1.0 Slide 11 of 38
  • 12. Core Development with the Microsoft .NET Framework 2.0 Foundation Just a minute What is bootstrapping? Answer The process of installing and configuring the CLR by using deployment tools is called bootstrapping. Ver. 1.0 Slide 12 of 38
  • 13. Core Development with the Microsoft .NET Framework 2.0 Foundation Managing an Event Log What are Event Logs? • Event logs are similar to a catalog where you can store entries for particular activities and actions that occur within your application. • Windows maintains the following types of event logs: • System Event Log: Logs information that takes place on system level hardware. • Security Event Log: Logs security level events. • Application Log: Contains events logged by applications or programs. • Event logs can be viewed programmatically by using the EventLog class. • EventLogPermission class allows you to specify code access security permissions for event logs. Ver. 1.0 Slide 13 of 38
  • 14. Core Development with the Microsoft .NET Framework 2.0 Foundation Managing an Event Log (Contd.) The following code example demonstrates the creation of a custom event log and a custom event source: class MyEventLog { public static void Main() { //Create the source, if it does not already exist. if (!EventLog.SourceExists("MySource")) { EventLog.CreateEventSource("MySource","MyNewLog"); Console.WriteLine("CreatingEventSource"); } //Create an EventLog instance and assign its source. EventLog myLog = new EventLog(); myLog.Source = "MySource"; myLog.WriteEntry("Writing to event log."); } } Ver. 1.0 Slide 14 of 38
  • 15. Core Development with the Microsoft .NET Framework 2.0 Foundation Managing an Event Log (Contd.) How Entries Are Read and Written in an Event Log? The EventLog class can be used to read and write entries in existing logs. The properties of the EventLog class are: Log MachineName Entries Source WriteEvent WriteEntry Ver. 1.0 Slide 15 of 38
  • 16. Core Development with the Microsoft .NET Framework 2.0 Foundation Just a minute How do you write to an event log? Answer The EventLog class provides properties Source, WriteEvent, and WriteEntry that are used to write entries to an existing event log. Ver. 1.0 Slide 16 of 38
  • 17. Core Development with the Microsoft .NET Framework 2.0 Foundation Working with Application Processes How a List of All Running Processes Is Retrieved? • The GetProcesses method of the Process class is used to retrieve the list of all the processes running on the computer. • It returns an array that lists all the running processes. How Information About the Current Process Is Retrieved? The GetCurrentProcess method of the Process class is used to retrieve information about the current process. How a List of All Modules Used by a Process Is Retrieved? The Process class provides the Modules method that can be used to retrieve a list of all the modules used by a process. Ver. 1.0 Slide 17 of 38
  • 18. Core Development with the Microsoft .NET Framework 2.0 Foundation Working with Application Processes (Contd.) How an Application Process Is Started and Stopped? The Start method is used to start a process. The Kill method stops the specified process immediately. It releases the resources allocated to the process. Ver. 1.0 Slide 18 of 38
  • 19. Core Development with the Microsoft .NET Framework 2.0 Foundation Managing Application Performance Monitoring Application Performance by Using the Performance Monitor In Windows 2000 and Windows XP, the Performance Monitor is used to examine the performance of your applications. The System Monitor in the Performance Monitor is used to monitor the execution of processes. Each monitored resource in the Performance Monitor is called a performance object. Each performance object has certain performance counters associated with it. Ver. 1.0 Slide 19 of 38
  • 20. Core Development with the Microsoft .NET Framework 2.0 Foundation Managing Application Performance (Contd.) How Performance Information Is Customized by Using Performance Counter Classes? The System.Diagnostics namespace provides several classes that can be used to create custom performance counters. The important classes are: PerformanceCounter: Evaluates feedback from existing counters. PerformanceCounterCategory: Creates or removes custom categories. CounterCreationData: Creates multiple counters in a category and specifies their types. Ver. 1.0 Slide 20 of 38
  • 21. Core Development with the Microsoft .NET Framework 2.0 Foundation Debugging Applications What is Debugging? • The process of finding and correcting the defects in a block of code is called debugging. • Debugging helps you resolve several kinds of errors. These errors can be divided into the following types: • Syntax error • Run-time error • Logic error • The Microsoft CLR Debugger is run to debug an application. • The Microsoft CLR Debugger is installed when you install Visual Studio 2005. • It is part of the Visual Studio 2005 Software Development Kit (SDK). Ver. 1.0 Slide 21 of 38
  • 22. Core Development with the Microsoft .NET Framework 2.0 Foundation Debugging Applications (Contd.) How the Debugger Class Is Used to Debug Programmatically? The .NET Framework provides the Debugger class, which helps to launch the Visual Studio 2005 debugger programmatically. The primary methods associated with the Debugger class: Break: This method signals a breakpoint to an attached debugger, with a user breakpoint event. Launch: This method launches a debugger and attaches it to the process. Log: This method posts a message for the attached debugger. Ver. 1.0 Slide 22 of 38
  • 23. Core Development with the Microsoft .NET Framework 2.0 Foundation Debugging Applications (Contd.) The following code sample shows the implementation of the Debugger class: private void BreakInCode() { BooleanSwitch assertSwitch = new BooleanSwitch("BreakOnAssert", ""); if (assertSwitch.Enabled) { if (Debugger.IsAttached) Debugger.Break(); else Debugger.Launch(); } } Ver. 1.0 Slide 23 of 38
  • 24. Core Development with the Microsoft .NET Framework 2.0 Foundation Debugging Applications (Contd.) How the Debug Class Is Used to Debug Programmatically? The Debug class provides a set of methods and properties that help in debugging code. Methods in the Debug class can be used to print debug information. A few primary methods associated with the Debug class: Assert: This method checks a condition. If the condition is false, the method displays a message. WriteLine: This method writes information about the debug to the trace listeners in the Listeners collection. WriteLineIf: This method checks a condition, and if the condition holds true, the method writes information about the debug to the trace listeners in the Listeners collection. Ver. 1.0 Slide 24 of 38
  • 25. Core Development with the Microsoft .NET Framework 2.0 Foundation Debugging Applications (Contd.) How User-Defined Types Are Configured by Using Debugger Attributes? The Debugger attributes are a set of classes that can be used to configure user-defined types in a debugger. How Call Stacks Are Managed by Using the StackFrame and StackTrace Classes? StackFrame Class: Provides information about a stack frame. A stack frame is the physical representation of a function call on the call stack for the current thread. The members of the StackFrame class are: GetFileName method: This method is used to retrieve the name of the file that has provided the code in execution. GetFileLineNumber method: This method is used to retrieve the line number in the file that contains the code currently in execution. Ver. 1.0 Slide 25 of 38
  • 26. Core Development with the Microsoft .NET Framework 2.0 Foundation Just a minute What are the different kinds of errors? Answer The different kinds of errors are syntax errors, runtime errors, and logic errors. Ver. 1.0 Slide 26 of 38
  • 27. Core Development with the Microsoft .NET Framework 2.0 Foundation Tracing Applications • What Is Application Tracing? Application tracing refers to monitoring an application and recording information about events as they occur in the application. Trace commands such as Trace.Write, Trace.TraceInformation, Trace.TraceError, Trace.Indent, and Trace.Assert enable a user to trace an application. The .NET Framework provides the System.Web.TraceContext class for a Web environment. For a Windows environment, the .NET Framework provides the System.Diagnostics.Trace and System.Diagnostics.Debug classes. Ver. 1.0 Slide 27 of 38
  • 28. Core Development with the Microsoft .NET Framework 2.0 Foundation Tracing Applications (Contd.) • How Applications Are Traced Programmatically by Using the Trace Class? The Trace class provides a set of methods and properties that help you to trace applications programmatically. The members of the Trace class are: Assert WriteIf Fail Write WriteLine WriteLineIf With the help of a configuration file, you can use the Trace class programmatically in a console application to implement tracing. Ver. 1.0 Slide 28 of 38
  • 29. Core Development with the Microsoft .NET Framework 2.0 Foundation Tracing Applications (Contd.) • How the Source of Tracing Is Identified by Using the TraceSource Class? The .NET Framework provides the TraceSource class that helps to trace the execution of code and associate trace messages with their source. The members of the TraceSource class are: TraceEvent TraceData TraceInformation Name Switch Listeners With the help of a configuration file, you can configure and implement the TraceSource class. Ver. 1.0 Slide 29 of 38
  • 30. Core Development with the Microsoft .NET Framework 2.0 Foundation Tracing Applications (Contd.) You can also implement the TraceSource class by using C# to trace an application and associate trace messages with their source. The following code sample shows the implementation of the TraceSource class: using System; using System.Diagnostics; class Tracetest { static TraceSource tS = new TraceSource("TraceTest"); static void Main(string[] args) { tS.Listeners["console"].TraceOutputOp tions |= TraceOptions.Callstack; tS.TraceEvent(TraceEventType.Warning, 1); } } Ver. 1.0 Slide 30 of 38
  • 31. Core Development with the Microsoft .NET Framework 2.0 Foundation Tracing Applications (Contd.) • How the Tracing Output Is Configured by Using Trace Switch Classes? The trace switches are used to activate, deactivate, and filter the tracing output. The two types of trace switch classes are: TraceSwitch BooleanSwitch The configuration file is used to add a switch and define its value, remove a switch, or get rid of all switches set up initially by the application. Ver. 1.0 Slide 31 of 38
  • 32. Core Development with the Microsoft .NET Framework 2.0 Foundation Tracing Applications (Contd.) The following code sample shows the implementation of the TraceSwitch class. using System; using System.Diagnostics; class Tracetest { // Create a TraceSwitch to use in the entire application class level declaration private static TraceSwitch appSwitch = new TraceSwitch("mySwitch", "Switch in config file"); Ver. 1.0 Slide 32 of 38
  • 33. Core Development with the Microsoft .NET Framework 2.0 Foundation Tracing Applications (Contd.) public static void Main(string[] args) { Console.WriteLine("Trace switch {0} configured as {1}", appSwitch.DisplayName,appSwitch.Level.ToString() ); if (appSwitch.TraceError) { //... } } } Ver. 1.0 Slide 33 of 38
  • 34. Core Development with the Microsoft .NET Framework 2.0 Foundation Tracing Applications (Contd.) • How the Tracing Output Is Directed by Using Trace Listener Classes? Trace listeners are objects used to send the trace information to an output location, such as a file, a printer, or the Visual Studio 2005 output window. The various trace listener classes are: TraceListener XmlWriterTraceListener DelimitedListTraceListener EventLogTraceListener The TraceFilter class allows you to filter trace information before sending it to an output location. With the help of a configuration file, you can configure and implement the TraceListener class. Ver. 1.0 Slide 34 of 38
  • 35. Core Development with the Microsoft .NET Framework 2.0 Foundation Tracing Applications (Contd.) • How Trace Information Is Categorized by Using the CorrelationManager Class? The CorrelationManager class is used to group and classify trace information for later analysis. It is connected with the Thread class by the CorrelationManager property. The namespace for the CorrelationManager class is System.Diagnostics, and the assembly is System (in System.dll). Ver. 1.0 Slide 35 of 38
  • 36. Core Development with the Microsoft .NET Framework 2.0 Foundation Just a minute What is the TraceSource class? Answer The TraceSource class belongs to the System.Diagnostics namespace and is used to trace the execution of code and associate trace messages with their source. Ver. 1.0 Slide 36 of 38
  • 37. Core Development with the Microsoft .NET Framework 2.0 Foundation Summary • In this session, you learned that: The application configuration file helps specify configuration settings for applications other than Web applications. mscorcfg.msc is a .NET Framework utility that helps configure an application so that the application can use the externally referenced assemblies. Garbage collection is a feature provided by the .NET Framework to automatically manage the allocation and release of memory for the managed objects in an application. Event logs contain entries to record important software and hardware events. An instance of an application under execution is called a process. You need to manage the performance of your application to identify operational issues and optimize performance. Ver. 1.0 Slide 37 of 38
  • 38. Core Development with the Microsoft .NET Framework 2.0 Foundation Summary (Contd.) Debugging helps you ensure that the code provides expected results. You can use tracing to monitor the code and the target points where an application deviates from the normal functioning. Ver. 1.0 Slide 38 of 38

Notes de l'éditeur

  1. Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  2. Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  3. Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  4. Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  5. Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  6. Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  7. Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  8. Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  9. Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  10. Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  11. Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  12. Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  13. Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  14. Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  15. Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  16. Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  17. Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  18. Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  19. Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  20. Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  21. Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  22. Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  23. Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  24. Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  25. Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  26. Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  27. Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  28. Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  29. Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  30. Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  31. Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  32. Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  33. Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  34. Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  35. Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  36. Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  37. Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  38. Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.