Published on

An Introduction on .NET Framework

Published in: Technology
No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide


  1. 1. Microsoft .NET Framework Ch. Vishwa Mohan M.Sc., M.Tech Freelance Software Consultant & Corporate Trainer
  2. 2. <ul><li>Introduction to .NET Framework </li></ul><ul><li>Introduction to Visual Studio </li></ul><ul><li>C# Language </li></ul><ul><li>Advanced .NET Programming </li></ul><ul><li>Windows Based Application Development </li></ul><ul><li>ASP.NET Web Development. </li></ul>Table of Contents
  3. 3. <ul><li>Microsoft.NET is a set of Microsoft software technologies for connecting information, people, systems and devices. </li></ul><ul><ul><li>It enables high level of software integration through the use of XML Web Services. </li></ul></ul><ul><li>The .NET is a platform that provides a standardized set of services: </li></ul><ul><ul><li>It’s just like Windows, except distributed over the Internet. </li></ul></ul><ul><ul><li>It exports a common interface so that it’s programs can be run on any system that supports .Net. </li></ul></ul><ul><li>Goals of .NET </li></ul><ul><ul><li>Tie all devices to the Internet </li></ul></ul><ul><ul><li>Software as a service </li></ul></ul><ul><ul><li>Data and applications accessible on all devices </li></ul></ul><ul><ul><ul><li>Truly compile once, run anywhere </li></ul></ul></ul><ul><ul><ul><li>Scalability </li></ul></ul></ul>What is .NET ?
  4. 4. <ul><li>.NET was designed to replace all legacy Microsoft Languages </li></ul><ul><ul><li>J++, C++, ASP, Visual Basic. </li></ul></ul><ul><li>Offers Language uniformity. </li></ul><ul><li>.NET Provides Common Intermediate Language IL (or MSIL) </li></ul><ul><ul><li>IL concept is based on CLI. CLI is a standard not a language. </li></ul></ul><ul><ul><li>C#, VB.NET, J# compiles into IL. </li></ul></ul><ul><ul><li>Non-interpreted, Just-In-Time (JIT) Compiled Code. </li></ul></ul><ul><ul><li>Each client has CLR. </li></ul></ul><ul><li>CLR is your sandbox. Provides safe environment for code execution. </li></ul>An Overview on .NET
  5. 5. Code Execution in .NET
  6. 6. <ul><li>Choosing CLR complaint compiler </li></ul><ul><li>Compile your code into Microsoft Intermediate Language MSIL (or IL assembly language code). </li></ul><ul><li>Compiling MSIL into Native Code. </li></ul><ul><ul><li>Compilation by Just-in-time compiler </li></ul></ul><ul><ul><li>Install-time Code generation using NGen.exe. </li></ul></ul><ul><li>Executing Code. </li></ul>Managed Execution Process
  7. 7. Compilation and Execution Cycle Compilation Before installation or the first time each method is called Execution JIT Compiler Native Code MSIL Code Metadata Source Code Language Compiler
  8. 8. Why do you need .NET Framework 3.5? Create applications that run anywhere: mobile devices, browsers, desktops, and servers Enables better collaboration between developers and designers to create rich user experiences Productivity improvements like LINQ to provide a single platform for quickly building apps that run anywhere Simplifies building applications with messaging systems and/or workflows Connected Compelling Ubiquitous & Productive
  9. 9. Different Versions of .NET Framework Microsoft .NET Framework v2.0 Microsoft .NET Framework v3.5 Microsoft .NET Framework v1.1 Microsoft .NET Framework v3.0 Microsoft .NET Framework v1.0 Microsoft .NET Framework v4.0
  10. 10. <ul><li>Common language runtime (CLR). </li></ul><ul><li>Support for generic types and methods. </li></ul><ul><li>Compilers for C#, Visual Basic, C++, and J#. </li></ul><ul><li>Base class libraries. </li></ul><ul><li>ADO.NET. </li></ul><ul><li>ASP.NET. </li></ul><ul><li>Windows Forms. </li></ul><ul><li>XML Web services. </li></ul><ul><li>.NET Remoting </li></ul>Technologies in .NET Framework V2.0
  11. 11. What was new in .NET Framework 3.0? build user interfaces for applications and media-rich experiences build and run connected systems, with a focus on Web services build workflow-enabled applications build secure online user authentication .NET FRAMEWORK Windows Presentation Foundation (WPF) Windows Workflow Foundation (WF) Windows Communication Foundation (WCF) Windows Cardspace
  12. 12. What is Microsoft .NET Framework 3.5? <ul><li>2.0 = ASP.NET, CLR, Web Services, WinForms </li></ul><ul><li>3.0 = Cardspace, WCF, WF, WPF </li></ul><ul><li>3.5 = AJAX, LINQ, REST, RSS </li></ul>.NET Framework 3.5 .NET Framework 3.0 SP1 Microsoft Visual Studio 2008 .NET Framework 2.0 SP1
  13. 13. <ul><li>Support for developing AJAX enabled web sites. </li></ul><ul><ul><li>Both server centric and Client centric. </li></ul></ul><ul><li>New compilers for C#, Visual Basic, and C++. </li></ul><ul><li>Support for ASMX and WCF based Web Services. </li></ul><ul><li>Enhancements in CLR includes: </li></ul><ul><li>Improvement in Networking. </li></ul><ul><li>New web protocols in WCF. </li></ul><ul><li>Integration of WCF with WF </li></ul><ul><ul><li>Exposing WF workflow as WCF service. </li></ul></ul><ul><li>LINQ & Data Awareness </li></ul><ul><li>Expression Tress </li></ul><ul><li>Full tooling support in VS2008 for WF, WCF and WPF. </li></ul>Enhancements in .NET Framework V3.5
  14. 14. Introduction to .NET Architecture Microsoft .NET Framework
  15. 15. <ul><li>The .NET Framework supports building and running different kinds of applications and Web services. </li></ul><ul><li>The .NET Framework designed to fulfill the following: </li></ul><ul><ul><li>To provide code execution environment : </li></ul></ul><ul><ul><ul><li>To minimize software deployment and versioning problems, </li></ul></ul></ul><ul><ul><ul><li>Supporting safe execution of code (i.e., code access security) </li></ul></ul></ul><ul><ul><ul><li>Eliminates performance problems of scripted or interpreted environments. </li></ul></ul></ul><ul><ul><li>Same type of development environment for Windows based and Web based applications. </li></ul></ul><ul><ul><li>Ensured all external communications are industrial standards so that code based on .NET framework can integrate with any other code. </li></ul></ul><ul><li>The .NET Framework has two main components: </li></ul><ul><ul><li>Common Language Runtime (CLR) </li></ul></ul><ul><ul><li>.NET Framework Class Library </li></ul></ul>Overview of .NET Framework
  16. 16. .NET Framework Platform & Tools Operating System Common Language Runtime Base Class Library ADO.NET and XML ASP.NET Web Forms Web Services Windows® Forms Common Language Specification VB C++ C# J# …
  17. 17. CLR Internals Class Loader IL to Native Compilers Code Manager Garbage Collector Security Engine Debug Engine Type Checker Exception Manager Thread Support COM Marshaler Base Class Library Support
  18. 18. <ul><li>The CLR is the execution engine for the .NET framework applications. </li></ul><ul><li>Code running under the control of the CLR often referred as managed code. </li></ul><ul><li>CLR provides, </li></ul><ul><ul><li>Code management (loading and executions) </li></ul></ul><ul><ul><li>Application memory isolation </li></ul></ul><ul><ul><li>Automatic memory management. </li></ul></ul><ul><ul><li>Enforcement of code access security. </li></ul></ul><ul><ul><li>Built in support for language interoperability. </li></ul></ul><ul><ul><li>Exception handling, including cross-language exceptions. </li></ul></ul><ul><ul><li>Thread Management </li></ul></ul><ul><ul><li>Enforcing strict type checking to promote robustness. </li></ul></ul><ul><ul><li>Interop Services for old COM objects and DLL’s. </li></ul></ul><ul><ul><li>Versioning problems solved. Removal on Registration dependency. </li></ul></ul>Common Language Runtime (CLR)
  19. 19. <ul><li>Microsoft Ships Several Languages: </li></ul><ul><ul><li>C#, </li></ul></ul><ul><ul><li>VB.NET </li></ul></ul><ul><ul><li>C++ (With managed extensions) </li></ul></ul><ul><ul><li>JScript.NET </li></ul></ul><ul><ul><li>J#, </li></ul></ul><ul><ul><li>ILasm </li></ul></ul>Languages Targeted for CLR <ul><li>Third Party Languages </li></ul><ul><ul><li>Eiffel by Eiffel Software </li></ul></ul><ul><ul><li>COBOL by Fujistu </li></ul></ul><ul><ul><li>FORTRON </li></ul></ul><ul><ul><li>Delphi by Borland </li></ul></ul><ul><ul><li>Perl by ActiveState </li></ul></ul><ul><ul><li>Many Research toy languages. </li></ul></ul>
  20. 20. <ul><li>The .NET Framework, is a comprehensive, object-oriented collection of reusable types that tightly integrate with CLR. These types can be used to develop any type of applications like Console based, Traditional GUI or Web Applications. </li></ul><ul><li>The .NET framework types perform the following functions. </li></ul><ul><ul><li>Represent base data types and functions. </li></ul></ul><ul><ul><li>Encapsulate data structures. </li></ul></ul><ul><ul><li>Perform I/O </li></ul></ul><ul><ul><li>Access information about loaded types. </li></ul></ul><ul><ul><li>Invoke .NET framework security check. </li></ul></ul><ul><ul><li>Provide data access. </li></ul></ul>The .NET Framework Class Library
  21. 21. <ul><li>The .NET Framework has a rich set of class library. </li></ul><ul><li>This class library provides a common consistent development interface across all languages supported by .NET. </li></ul><ul><li>The .NET Class Library consists classes for IO, Threading, Database, Text, Graphics, Socket, Web/Mail, Security, Cryptography , etc., </li></ul><ul><li>The Class Library major parts are: </li></ul><ul><ul><li>Base Frame Work </li></ul></ul><ul><ul><li>Data and XML </li></ul></ul><ul><ul><li>ASP.NET </li></ul></ul><ul><ul><li>Windows Forms </li></ul></ul><ul><li>These classes are arranged using dot syntax naming scheme that connotes a hierarchy. It also called as Namespace. </li></ul><ul><ul><li>Eg: System.Collection.ArrayList represents ArrayList type which belongs to System.Collection Namespace. </li></ul></ul><ul><ul><li>System name space is the root namespace for the fundamental types of .NET. </li></ul></ul>The .NET Framework Class Library
  22. 22. The .NET Unified Classes Diagnostics Configuration Collections Net IO Threading Text Security Common OLEDB SQLTypes SQLClient XPath XSL Runtime InteropServices Remoting Serialization Serialization Configuration SessionState Caching Security Services UI HTMLControls WebControls Imaging Drawing2D Text Printing Design ComponentModel Schema Reflection Resources Globalization ServiceProcess System System.XML System.Web (ASP .NET) System.Drawing System.Windows.Forms System.Data Schema Description Discovery Protocols
  23. 23. Relationship between CLR, Class Library and Your Application.
  24. 24. <ul><li>Any code before executed by the CLR need to be compiled. Compilation occurs in two steps in .NET </li></ul><ul><ul><li>Compilation of source code in to IL. </li></ul></ul><ul><ul><li>Compilation of IL to platform specific code by CLR. </li></ul></ul><ul><li>Advantages of Managed Code: </li></ul><ul><ul><li>Platform Independency </li></ul></ul><ul><ul><li>Language Interoperability </li></ul></ul><ul><ul><li>Performance Improvement </li></ul></ul><ul><li>IL is a classic Object Oriented programming language with single implementation inheritance of classes. So any language that targeting to IL need to follow this methodology. Some of the important features of IL: </li></ul><ul><ul><li>Object orientation and use of interfaces. </li></ul></ul><ul><ul><li>Strong distinction between value types and reference types. </li></ul></ul><ul><ul><li>Strong data typing </li></ul></ul><ul><ul><li>Use of attributes. </li></ul></ul><ul><ul><li>Error Handling using exceptions. </li></ul></ul>Advantages of Managed Code
  25. 25. <ul><li>In .NET, </li></ul><ul><ul><li>All objects implicitly derived from single base class System.Object . </li></ul></ul><ul><ul><li>The CTS is the core part of the CLR that takes cares cross language integration. </li></ul></ul><ul><ul><li>The CTS offers wide range of types and operations that found in many programming languages. </li></ul></ul><ul><ul><li>The CTS supports two general categories of types: </li></ul></ul><ul><ul><ul><li>Value Types : Include simple types (char, int, float, etc.,), enum types and struct types. </li></ul></ul></ul><ul><ul><ul><li>Reference Types : Includes class types, interface type, delegate types and array types. </li></ul></ul></ul><ul><li>The common Type System performs the following functions: </li></ul><ul><ul><li>Facilitates cross-language integration, type-safety and high performance code execution. </li></ul></ul><ul><ul><li>Provides an object-oriented model and defines a set of rules that language have to follow. </li></ul></ul>Common Type System (CTS)
  26. 26. <ul><li>In .NET, </li></ul><ul><ul><li>A class written in one language can inherit a class written in another language. </li></ul></ul><ul><ul><li>The class can contain instance of another class written in different language. </li></ul></ul><ul><ul><li>An object can directly call methods against another object written in another language. </li></ul></ul><ul><ul><li>Object (or reference to objects) can be passed around between methods. </li></ul></ul><ul><li>To address the above, one language need to support equivalent data types present in different language. This data type problem solved in .NET through the Common Type System . </li></ul><ul><ul><li>The CTS defines the predefined data types that are available in IL. So all the languages that targets the .NET will produce the compiled code ultimately based on these types. </li></ul></ul><ul><ul><li>The CTS doesn’t specify merely primitive data types but a rich hierarchy of types. Everything actually an object. </li></ul></ul><ul><ul><li>Specifies rules for Class, Enum, Struct, interface, delegate, etc., </li></ul></ul>Common Type System (CTS)
  27. 27. <ul><li>The CTS defines how types are declared, used and managed in the runtime. So runtime can support cross language integration. </li></ul><ul><li>The CTS performs the following functions: </li></ul><ul><ul><li>Establishes a framework that helps enable cross-language integration, type safety, and high performance code execution. </li></ul></ul><ul><ul><li>Provides an object-oriented model that supports the complete implementation of many programming languages. </li></ul></ul><ul><ul><li>Defines rules that languages must follow, which helps ensure that objects written in different languages can interact with each other. </li></ul></ul><ul><li>The Common Type System supports two general categories of types, each of which is sub divided into further categories: </li></ul><ul><ul><li>Value Types </li></ul></ul><ul><ul><li>Reference Types. </li></ul></ul><ul><li>All types derived from System.Object base type. </li></ul>Common Type System (CTS)
  28. 28. <ul><li>Below diagram shows various types and their relations. </li></ul><ul><ul><li>Instance of a type can be simply value type or self describing type even though they are sub categories of these types. </li></ul></ul><ul><ul><li>In C#, each predefined type recognized by the compiler and maps into one of the IL built-in types. </li></ul></ul>Type Classification
  29. 29. <ul><li>CLS rules define a subset of the CTS; i.e., all the rules that apply to the CTS apply to the CLS, except where stricter rules are defined in the CLS. </li></ul><ul><li>The CLS works with the CTS to ensure language interoperability. The CLS is a set of standards that all compilers targeting to .NET must support. </li></ul><ul><ul><li>Most of the compilers will support the subset features offered by the IL and CTS. (Because IL is very rich language). </li></ul></ul><ul><ul><li>It is perfect to write non-CLS complaint code. But it is not guaranteed to be fully language interoperable. </li></ul></ul><ul><ul><li>CLS-complaint features applies only to public and protected members of classes and public classes . </li></ul></ul><ul><ul><li>Within the private implementation of class you can write whatever non-CLS code you want. </li></ul></ul><ul><li>The common language runtime compiles all code written in a CLS-compliant language, to the same kind of intermediate code (IL) –MSIL. </li></ul><ul><li>You can mark assemblies, modules, types, and members as either CLS-compliant or not CLS compliant using the CLSCompliantAttribute. </li></ul>Common Language Specifications (CLS)
  30. 30. <ul><li>Automatic management is one of the services provided by CLR during managed execution. </li></ul><ul><li>Automatic memory management can eliminate common problems, such as forgetting to free an object and causing a memory leak, or attempting to access memory for an object that has already been freed. </li></ul><ul><ul><li>CLR’s Garbage collector will do all theses memory management activities. </li></ul></ul><ul><li>Garbage collector will release the memory for the unused objects at free time. </li></ul><ul><li>To optimize the performance of the garbage collector, the managed heap is divided into three generations: 0, 1, and 2. </li></ul><ul><li>Unmanaged resources require explicit cleanup. (Eg: Object wraps OS resources such as file handle, windows handle, network connection). </li></ul><ul><ul><li>GC knows the lifetime of the object that wraps these resources. But it doesn’t aware of these resources. So release these resources you need to done in public Dispose method. </li></ul></ul>Automatic Memory Management
  31. 31. <ul><li>An assembly is a unit of deployment. </li></ul><ul><li>Assembly contains code that CLR executes. MSIL code in PE file will not execute if it doesn’t have assembly manifest. </li></ul><ul><li>Each assembly can have only one entry point ( DllMain , WinMain or Main ). </li></ul><ul><li>Assembly forms security boundary. So permissions requested at assembly level. </li></ul><ul><li>Assembly forms version boundary. Assembly is the smallest versionable unit in the CLR. </li></ul><ul><li>Assemblies are self describing. </li></ul><ul><li>Assemblies can be static and dynamic. </li></ul><ul><li>Within Assembly Type information (metadata) Consists of: </li></ul><ul><ul><li>Describes every class type. </li></ul></ul><ul><ul><li>Complete Interface Information. </li></ul></ul><ul><ul><li>Automatically bound into assembly, inseperable, stored in binary format. </li></ul></ul>Assemblies in .NET
  32. 32. Assemblies in .NET
  33. 33. <ul><li>Assembly is nothing but .NET Library or Executable (PE file format). </li></ul><ul><li>Single-file or multi-file assemblies. </li></ul><ul><li>Assembly components are: Metadata, IL Code, Resources. </li></ul><ul><li>Assemblies eliminate DLL problem. </li></ul><ul><li>Locations are resolved at runtime. </li></ul><ul><li>Assembly can contain both managed and unmanaged code. </li></ul>Assemblies: Assemblies Metadata
  34. 34. <ul><li>Assemblies cab have Strong name and Version number </li></ul><ul><li>Publisher can set versioning policy. Publisher can provide strong name to assembly. </li></ul><ul><li>Domain/Local Administrator can set versioning policy. </li></ul><ul><li>The runtime resolve several steps to resolve an assembly binding: </li></ul><ul><ul><li>Checks the original assembly reference to determine the version of the assembly to be bound. </li></ul></ul><ul><ul><li>Checks for all applicable configuration files to apply version policy. </li></ul></ul><ul><ul><li>Determines the correct assembly from the original assembly reference and any redirection specified in the configuration files, and determines the version that should be bound to the calling assembly. </li></ul></ul><ul><ul><li>Checks the GAC, Multiple versions can be loaded side-by-side. </li></ul></ul><ul><li>Each assembly have two distinct ways of expressing version information: </li></ul><ul><ul><li>Version Number together with assembly name and culture info. </li></ul></ul><ul><ul><li>Informational version. </li></ul></ul>Assembly Versioning
  35. 35. <ul><li>Managed code runs within the protective confines of the CLR. </li></ul><ul><li>Before the CLR Executes code: </li></ul><ul><ul><li>Verifies it for type safety. </li></ul></ul><ul><ul><li>Enforces the Code Access Security Policy. </li></ul></ul><ul><li>Remember the CLR sits on top of Windows: </li></ul><ul><ul><li>CLR Security complements windows security (doesn’t replace). </li></ul></ul><ul><li>.NET Strongly Enforces the Microsoft Mantra “ Do it our way ”. </li></ul><ul><ul><li>Security by design by default. </li></ul></ul><ul><ul><li>“ The Microsoft Way” is secure and easy. Microsoft encourage developers to write secure code by making security implementations easy way. </li></ul></ul><ul><ul><li>Hard work to make .NET applications insecure. </li></ul></ul><ul><ul><li>IL can be verified to guarantee type safety </li></ul></ul><ul><ul><li>No unsafe casts, no un-initialized variables and no out-of-bounds array indexing. </li></ul></ul>Security in .NET
  36. 36. <ul><li>Role-based security. </li></ul><ul><li>Evidence-based, Code Access Securiy </li></ul><ul><ul><li>Declarative Security </li></ul></ul><ul><ul><li>Imperative Security </li></ul></ul><ul><li>Isolated Storage Container </li></ul><ul><li>Link Demands </li></ul><ul><li>Cryptography </li></ul><ul><li>Partially Trusted files can be read/write files through by using standard dialogs. </li></ul>.NET Security Mechanism
  37. 37. <ul><li>Type safety verification performed during JIT compile. </li></ul><ul><li>Primary functions: </li></ul><ul><ul><li>Ensures methods are called in correct manner (parameters, etc.,). </li></ul></ul><ul><ul><li>Authorize memory access (thus preventing buffer overruns etc.,) </li></ul></ul><ul><ul><li>Apply CAS policy. </li></ul></ul><ul><li>Code produced by C# unsafe keyword cannot be checked. </li></ul><ul><ul><li>Higher privileges required to run unsafe code. </li></ul></ul><ul><li>.NET protective environment allows multiple applications to run within one process: </li></ul><ul><ul><li>1 .NET Process = Multiple Application Domains. </li></ul></ul>Type Safety Verification
  38. 38. <ul><li>Code Access Security (CAS) </li></ul><ul><ul><li>Grants rights to code depending on “ evidence ”. </li></ul></ul><ul><ul><li>Unlike Win32 security not based on User’s ID but “ Code’s ID ”. </li></ul></ul><ul><li>Two primary concepts in CAS are: </li></ul><ul><ul><li>Code Groups: </li></ul></ul><ul><ul><ul><li>Compartmentalizes code based on “membership criteria”, e.g.: </li></ul></ul></ul><ul><ul><ul><ul><li>Location (Internet, Intranet, Local Hard drive) </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Strong Name (Private Key signature) </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Custom Criteria (Authentication, XML Signature, etc.,). </li></ul></ul></ul></ul><ul><ul><ul><li>Code with matching criteria is encapsulated into a Code Group . </li></ul></ul></ul><ul><ul><ul><ul><li>A Code Group is associated with a Permission Set . </li></ul></ul></ul></ul><ul><ul><li>Permission Sets: </li></ul></ul><ul><ul><ul><li>Detailed list of what code can do. </li></ul></ul></ul><ul><ul><ul><li>Very specific/granular. </li></ul></ul></ul>Code Access Security
  39. 39. <ul><li>Application domains provide an isolation boundary for security, reliability, and versioning, and for unloading assemblies. </li></ul><ul><li>Application domains are typically created by runtime hosts. </li></ul><ul><li>You can run several application domains in a single process: </li></ul><ul><ul><li>With the same level of isolation between application domains that would exist in separate processes, but without incurring the additional overhead of making cross-process calls or switching between processes. </li></ul></ul><ul><ul><li>Dramatically increases server scalability. </li></ul></ul><ul><li>The isolation provided by application domains has the following benefits: </li></ul><ul><ul><li>Faults in one application cannot affect other applications. </li></ul></ul><ul><ul><li>Individual applications can be stopped without stopping the entire process. </li></ul></ul><ul><ul><li>Code running in one application cannot directly access code or resources from another application. </li></ul></ul><ul><ul><li>Permissions granted to code can be controlled by application domain in which it is running. </li></ul></ul>Application Domains:
  40. 40. <ul><li>At run time, all managed code is loaded into an application domain and is run by a managed thread . </li></ul><ul><ul><li>There is not a one-to-one correlation between application domains & threads. </li></ul></ul><ul><ul><li>Several threads can be executing in a single application domain at any given time and a particular thread is not confined to a single application domain. </li></ul></ul><ul><ul><ul><li>Threads are free to cross application domain boundaries; </li></ul></ul></ul><ul><ul><ul><li>A new thread is not created for each application domain. </li></ul></ul></ul><ul><ul><ul><li>The run time keeps track of which threads are running in which application domains. </li></ul></ul></ul><ul><ul><ul><li>You can locate the domain in which a thread is executing at any time by calling the GetDomain method. </li></ul></ul></ul><ul><li>Application domains are usually created and manipulated programmati-cally by runtime hosts. </li></ul><ul><li>The AppDomain class is the programmatic interface to application domains. It has methods to Execute assembly, Unload assembly, etc., </li></ul>Application Domains:
  41. 41. <ul><li>Why we need Interoperability? </li></ul><ul><ul><li>Allow managed and unmanaged code work together. </li></ul></ul><ul><ul><li>Reusability of COM components. </li></ul></ul><ul><ul><li>Usage of Windows native API. </li></ul></ul><ul><li>Challenges for Interoperability are: </li></ul><ul><ul><li>Synchronize Memory Allocation </li></ul></ul><ul><ul><li>Object Lifetime Management </li></ul></ul><ul><ul><li>Security </li></ul></ul><ul><ul><li>Two Way Communication </li></ul></ul><ul><li>PInvoke: Efficient and relatively easy way to call existing native code, without having to write glue code. </li></ul><ul><li>Managed C++ / C++/CLI: Very powerful way to write glue code for complex object models. </li></ul><ul><li>COM Interop: COM Interfaces and Objects can be used by .NET and Vice Versa. </li></ul>Integration with Legacy Code
  42. 42. <ul><li>The common language runtime has been designed to support a variety of different types of applications. Each type of application requires a runtime host to start it. </li></ul><ul><li>The .NET Framework ships with a number of different runtime hosts, includes: </li></ul><ul><ul><li>ASP.NET </li></ul></ul><ul><ul><li>Microsoft IE </li></ul></ul><ul><ul><li>Shell Executable </li></ul></ul><ul><li>Microsoft also provides API to create your own runtime hosts. </li></ul>Runtime Hosts
  43. 43. <ul><li>You can access data uses ADO.NET. </li></ul><ul><li>GDI+ allows advanced drawing. </li></ul><ul><li>Your windows application can make calls exposed through XML web services. </li></ul><ul><li>You can access OS services. </li></ul><ul><li>You can develop multi tier distributed applications with the help of .NET. </li></ul><ul><li>Improved localization support. </li></ul><ul><li>Windows forms features a security model that is code-based. </li></ul><ul><li>Extensive XML Supporting classes. </li></ul><ul><li>With WPF you can build rich media aware applications. </li></ul>Benefits of Windows Applications with .NET
  44. 44. <ul><li>Ch. Vishwa Mohan </li></ul><ul><li>M.Sc., M.Tech </li></ul><ul><li>Web: </li></ul><ul><li>Phone: +91- 9490995632 </li></ul>For More Details