ScholarQuill logoScholarQuillUniversity Notes
  • Notes
  • Past Papers
  • Blogs
  • Todo
Login
ScholarQuill logoScholarQuillUniversity Notes
Login
NotesPast PapersBlogsTodo
More
SubjectsDiscussionCGPA CalculatorGPA CalculatorStudent PortalCourse Outline
About
About usPrivacy PolicyReportContact
Notes
Past Papers
Blogs
Todo
Analytics
    Current Subject
    🧩
    Enterprise Application Development
    EC-332
    Progress0 / 37 topics
    Topics
    1. Overview of Enterprise Application Development: Microsoft technology history2. Introduction to .NET and its architecture3. Concept of MSIL, CLR, CLS, CTS4. Introduction to .NET framework: Managed and Unmanaged Code5. .Net Assembly6. Introduction to C# fundamentals7. Boxing and Unboxing8. Implementing multi-tier architecture9. Introduction to ADO.Net: SQL Injection, parameterized queries10. Usage of data set, Data adapter and command builder in disconnected model11. Introduction to delegate: Multicast delegates12. Introduction to windows forms13. HTML14. Introduction to javascript: javascript and its data types, variables, functions15. Debugging javascript using Firebug16. Introduction to various object models: Browser's Object (BOM), Document Object Model17. Introduction to Jquery: Jquery effects18. Introducing LINQ: LINQ to Objects, LINQ to SQL19. Query syntax, Operations (projection, filtering and join) using Linq Queries20. Introduction to ADO.NET entity framework: The entity data model, CSDL21. Eager vs lazy loading, POCO classes, DBContext API22. Querying entity data models23. Introduction to ASP.NET MVC24. MVC application structure, Controllers overview25. Action Methods, Parameterized action methods26. Introduction to razor syntax27. Code expressions, Code Blocks, Implicit Vs Explicit Code Expression28. Data annotations, Client and Server Side Validation29. Validation and model binding, Validation and model state30. MVC Membership, Authorization and security31. Introduction to service-oriented architecture: SOAP, WSDL32. Service contract, Data contract, XML, WCF bindings33. ABC of WCF, Restful services34. Consuming rest services (CRUD operations) using Jquery AJAX and JSON35. Introduction to web API36. Example of web API using CRUD Example37. MVC routing
    EC-332›.Net Assembly
    Enterprise Application DevelopmentTopic 5 of 37

    .Net Assembly

    6 minread
    1,021words
    Intermediatelevel

    A .NET Assembly is a fundamental building block of .NET applications. It is a compiled code library that contains all the necessary components (such as code, metadata, and resources) to run an application or a part of an application. In .NET, everything is packaged into assemblies, which can be executable files (EXEs) or libraries (DLLs).

    Key Features of .NET Assemblies

    1. Code (MSIL)

      • An assembly contains Microsoft Intermediate Language (MSIL) code, which is platform-independent. The MSIL code is compiled into machine code by the Common Language Runtime (CLR) when the program is run, using the Just-In-Time (JIT) compiler.
    2. Metadata

      • Assemblies contain metadata, which is information about the types, methods, properties, and other elements defined in the code. The metadata enables the CLR to understand the types of data and objects being used in the program. It also supports reflection, allowing programs to inspect their structure at runtime.
    3. Resources

      • Assemblies can include resources like images, strings, icons, or configuration data. These resources are used by the application and are often embedded within the assembly.
    4. Manifest

      • The assembly includes a manifest, which contains information about the assembly itself. This includes its version, culture, and any referenced assemblies (other libraries or components the assembly relies on).

    Types of Assemblies

    Assemblies in .NET can be categorized into two main types:

    1. Private Assemblies
      Private assemblies are intended for use by a single application and are stored in the application’s directory. They are typically not shared between different applications.

    2. Shared Assemblies
      Shared assemblies are intended to be used by multiple applications. They are stored in a central location, like the Global Assembly Cache (GAC), so they can be accessed by any application that needs them.

    Components of a .NET Assembly

    A .NET assembly consists of the following components:

    1. Assembly Manifest:

      • The manifest is a crucial part of an assembly and contains essential metadata about the assembly. It describes the assembly's version, culture, security information, references to other assemblies, and more.
    2. Type Metadata:

      • This includes information about the types defined in the assembly, such as classes, methods, fields, and properties. It tells the CLR how to load and manage types in memory.
    3. IL Code:

      • The assembly contains Microsoft Intermediate Language (MSIL) code, which is the language the CLR uses before compiling it into native machine code. The MSIL code is cross-platform and not dependent on the operating system or hardware.
    4. Resources:

      • Resources like images, localized strings, or other data are often embedded in the assembly. These resources can be used by the application at runtime.

    Characteristics of Assemblies

    1. Self-Describing:

      • An assembly is self-describing, meaning it includes enough information (metadata) to define the assembly, its types, and the relationships to other assemblies. The metadata in the assembly allows the CLR to understand what the assembly does and how to load it correctly.
    2. Versioning:

      • Assemblies in .NET support versioning, which means that an assembly can specify a version number. This allows for the correct version of the assembly to be loaded at runtime, ensuring compatibility with applications.
    3. Strong Names:

      • Assemblies can be given a strong name, which is a unique identifier for the assembly, including the name, version, culture, and a public key token. Strong names help avoid naming conflicts between assemblies and ensure that the correct version of the assembly is loaded.

    Assembly Loading

    When an application runs, the CLR uses the assembly to load the types and execute the code. This is done in several steps:

    1. Loading the Assembly:

      • The CLR loads the assembly into memory when required by the application. It locates the assembly based on its reference in the application's manifest, the assembly’s strong name, or other location specifications.
    2. JIT Compilation:

      • The CLR uses the Just-In-Time (JIT) compiler to convert the MSIL code within the assembly into native machine code for execution on the current hardware.
    3. Type Resolution:

      • The CLR resolves the types within the assembly to ensure they are compatible and can be used correctly in the application. It also manages references to other assemblies and loads them if needed.

    Global Assembly Cache (GAC)

    The Global Assembly Cache (GAC) is a central repository used to store shared assemblies. Assemblies placed in the GAC are available for use by any application on the system. Assemblies in the GAC must have a strong name to ensure they can be uniquely identified and correctly versioned.

    • Why use the GAC?
      • Shared Assemblies: When an assembly is meant to be used by multiple applications (like a utility library), the GAC provides a central place to store it.
      • Version Control: The GAC supports versioning, meaning that different applications can use different versions of the same assembly if needed.

    Building and Managing Assemblies

    • Building an Assembly:

      • When you compile a .NET project, the output is usually an assembly (EXE or DLL). For example, when you build a C# project using Visual Studio, it generates an assembly that can be executed (if it’s an EXE) or referenced (if it’s a DLL).
    • Viewing Assembly Information:

      • You can view the metadata and other details of an assembly using tools like ILSpy, Reflector, or the Assembly Explorer in Visual Studio.
    • Assembly References:

      • When you create an application that depends on other libraries or assemblies, you reference those assemblies in your project. The assembly references are included in your project’s metadata and ensure that the application can locate and load the required assemblies at runtime.

    Summary of .NET Assemblies

    • Assemblies are the core units of deployment and execution in .NET.
    • They contain compiled code, metadata, resources, and manifests.
    • There are two main types of assemblies: private assemblies (for single applications) and shared assemblies (stored in the GAC for multiple applications).
    • Managed code in .NET is executed from assemblies, with the CLR handling many runtime tasks such as memory management and security.
    • Assemblies support versioning and can be strongly named for security and consistency.
    • The GAC is used for storing shared assemblies that need to be used by multiple applications.

    In short, assemblies are a key concept in .NET, providing a well-organized way to package and manage code, resources, and metadata for .NET applications.

    Previous topic 4
    Introduction to .NET framework: Managed and Unmanaged Code
    Next topic 6
    Introduction to C# fundamentals

    Past Papers

    Open this section to load past papers

    Click on Show Past Papers to see past papers.
    On This Page
      Reading Stats
      Est. reading time6 min
      Word count1,021
      Code examples0
      DifficultyIntermediate