Microsoft's.NET framework, which offers a setting for executing, debugging, and deploying code onto online services and applications using tools and features including libraries,
classes, and APIs Programming using objects is used in this framework.
Various languages, including C#, Cobol, VB, F#, Perl, and others, can be used to create.NET framework
applications. This Framework supports a wide range of Windows services, websites, desktop programmes, and more. It offers features like generic types, automated memory management,
concurrency, reflection, etc. These features will make it simpler and more effective to construct high-quality client and online apps.
You've come to the right site if you're seeking for.Net Interview Questions & Answers for Experienced or Freshers. There are several chances available from numerous reputable businesses worldwide. Research indicates that.Net holds a market share of roughly 20.90%. Therefore, you still have the chance to advance in your.Net Analytics career. In order to assist you succeed in your interview and land your ideal job as a.Net Analyst, Logicmojo provides Advanced.Net Interview Questions.
Microsoft's.Net software framework is used to create programmes for Windows. It includes ASP.Net and languages like C#, VB.Net, COBOL, Perl, etc. It is comparable to other software development frameworks like Java Platform, Enterprise Edition (J2EE).
The.NET Platform includes another software framework for creating web applications called ASP.NET. The front end is built with the aid of ASP.NET, which utilises the web server IIS.
Common Type System is referred to as CTS. It adheres to a set of guidelines that specify how a data type should be declared and used in programme code. The data types that will be used in the application are also described by CTS. Following the CTS principles allows us to create our own classes and functions, which aids other programming languages in referencing data types specified in one programming language.
The.NET framework's CLR, or common language run-time, is a crucial element. The CLR can be used as a building block for many different applications and offers a secure execution environment.
When a C# programme is compiled, an intermediate language is created from the source code. The code is then written with CLR in mind, which carries out a number of tasks like memory management, security checks, loading assemblies, and thread management.
With the aid of several CLS principles, common language specification enables developers to use inter-language compatible components. The code can then be reused in other.NET compatible languages.
Just In Time, or JIT, is a type of compiler. The native language is utilised to translate the intermediate code. The intermediate code is changed into the native language during execution.
The following list outlines the primary distinctions between value type and reference type:
A reference type contains a pointer that contains the address of a different memory location that contains the actual data, whereas a value type holds the data directly
within the memory region.
Reference type data is stored on the heap memory, whereas value type data is stored on the stack memory.
While assigning a reference variable to another makes a second copy of the reference rather than copying the value, doing so with a value type variable copies the value directly.
Value types include predefined data types, structures, and enums. Reference types include things like classes, objects, arrays, indexers, interfaces, and more.
Assembly executable modules include EXE and DLL files.
An executable file, or EXE, runs the programme for which it was created. When we create an application, we generate an EXE file. As a result, when we start an EXE, the assemblies
are loaded immediately. An EXE cannot, however, be shared with other apps.
Code that needs to be concealed is contained in Dynamic Link Library (DLL), a library. This library contains the code in its entirety. Numerous DLLs that are shared by other
programmes and applications can be found in an application.
The following list includes the main parts of the.NET framework:
The code is executed by this engine, which also offers services that facilitate the development process.
Memory management, garbage collection, type safety, exception handling, security, and thread management are among the services offered by CLR. Additionally, it facilitates the
building of programmes and component parts whose objects interact beyond linguistic boundaries.
Regardless of the programming language used, the CLR executes applications created for the.NET Framework. CLR is present in every.NET Framework version.
FCL: Framework Class Library
It provides pre-defined properties and methods to implement basic and complicated functions that.NET programmes can use. Furthermore, it will have types for dates, strings, numbers, etc.
This class library contains APIs for connecting to databases, reading and writing files, drawing, etc.
BCL (Base Class Library):
In order to implement other programming languages such as C#, F#, Visual C++, etc. in the.NET Framework, the Base Class Library (BCL) has a vast array of library features and functions.
BCL is split into two halves. As follows:
Assemblies are contained in the user-defined class library.
Assembly: The main component of the.NET Framework is referred to as a.NET assembly. In the CLI (Common Language Infrastructure), an assembly is a logical unit of code used for deployment,
versioning, and security. Executable (.exe) files and Dynamic Link Libraries (.dll) are the two ways that assembly can be defined.
Microsoft Intermediate Language (MSIL)-generated information will be created and stored in an Assembly file during the compilation of the.NET programme.
Predefined class library: Namespace is present.
Namespace: The.Net Framework's collection of pre-defined classes and methods is known as this. Using "using system," where system stands in for a namespace and using is a keyword,
a namespace can be introduced to a.NET programme.
CTS: Common Type System
The CTS standard outlines the categories of data and value that can be defined and maintained in runtime memory.
In order to share information, it will ensure that programming data defined in various languages interact with one another. For instance, while C# defines int as a data type,
VB.NET defines integer as a data type.
When transferring data from a type in one language to its corresponding type in another, it can be utilised to avoid data loss.
CLS, or Common Language Specification
A subset of CTS called Common Language Specification (CLS) outlines a set of guidelines that all languages using the.NET Framework must adhere to.
the Base Class Library, or BCL. It serves as the basis for all.NET framework controls, components, and applications. It includes fundamentally sound types like System.String and System.DateTime and provides features like input/output, input/output security, diagnostics, and threading.
Cookies are discrete textual data packets. In order to identify users, the server creates cookies on the client. It could include the username and ID, interests, the option to remember your password, or any other data. Cookies are unique per domain.
The most widely used web server for hosting and offering internet-based services to ASP.NET and ASP Web applications is Internet Information Server (IIS).
For handling the requests, IIS includes a dedicated process engine. The ability to deploy ASP.NET Web applications is provided by using an IIS PC as a web server. Additionally,
it is in charge of giving users' requests replies.
An assembly is a file that the compiler automatically creates that contains a group of types and resources that are designed to cooperate and form a logical unit of functionality.
Additionally, we can say that an assembly programme is a compiled piece of code.
Can be implemented in assemblies (.exe) or dynamic link library (.dll) files.
A basic request and response API in ASP.Net is called HttpHandler. The ASP.NET web application server employs it to manage particular extension-based requests.
IL stands for Intermediate Language and is a compiler-friendly object-oriented programming language. During the execution of a virtual machine, it is converted to byte code. IL is frequently referred to as Microsoft Intermediate Language or Common Intermediate Language (CIL) (MSIL).
The Microsoft Intermediate Language, or MSIL, contains instructions for calling methods, initialising values, managing memory, handling exceptions, and other tasks. All.NET programmes are initially translated into Intermediate Language.
The memory's unneeded code objects must be released by the garbage collector. The common language runtime allots RAM for each new object that is generated.
There are two sorts of assemblies. As follows:
Private Meeting:
The application is the only one who can access it.
This private assembly needs to be copied separately into each application folder where it will be used. We are unable to access the private assembly without copying.
It must be set up in the application's installation directory.
Public or shared assembly:
It is a resource that several programmes can share.
Public assembly doesn't need to be copied individually into each application folder. At the system level, public assembly only needs one copy, and multiple programmes can share that copy.
In the Global Assembly Cache, it is installed (GAC).
Take a look at the following design principles to see how SOLID design is implemented in.Net:
Open-Closed Principle (OCP)
Single responsibility principle (SRP)
Interface segregation principle (ISP)
Liskov substitution principle (LSP)
Dependency inversion principle (DIP)
One parent window and as many child windows make up an MDI (Numerous Document Interface), which enables you to open multiple windows. The parent window's components,
such as the menu bar and toolbar, are shared.
Each document is opened in a distinct window using the single document interface, or SDI. Each window has its own features, such as a menu bar and toolbar. It is not limited to
the parent window as a result.
The information is saved on the same page every time we submit a form on a website. Cross-page posting, on the other hand, refers to the storage of information on a new page that is linked to the present one. The POSTBACKURL attribute allows for cross-page posting.
Delegates are.NET objects that define method signatures and have the ability to accept functions as parameters.
Delegate always directs the user to a method that exactly matches its signature. In a delegate object, users can include a method reference.
The referenced method will be called by the delegate object when it is sent to the programme. We can use delegate to add a unique event to a class.
The various caching techniques used by.Net include:
Page caching
Data caching
Fragment caching
Multipurpose Internet Mail Extensions is what MIME stands for. It is the e-mail protocol's extension that enables users to quickly share files through emails.
To identify a web transfer as a MIME transaction, servers add the MIME header at the beginning of the transmission.
The clients then make use of this header to choose an appropriate "player" for the data type that the header denotes. The web browser includes a few of these players by default.
To restrict unauthorised access to programmes and resources during runtime, Code Access Security (CAS) is required. It is intended to address the problems encountered with
receiving code from outside sources, which may have bugs and security holes that leave the user's system open to attack.
CAS provides limited access to code rather than all of it at once, allowing it to conduct only specific tasks. A component of the native.NET security architecture is created by CAS.
The process of adapting our application to the local culture and environment is known as localization.
Designing an application to support different languages allows it to be utilised by users from all over the world, a process known as globalisation.
The various components of an assembly are:
Every static or dynamic assembly contains a data collection called a manifest that describes how the components in the assembly relate to one another. An assembly manifest
includes all the metadata needed to define the assembly's scope, resolve references to classes and resources, and declare the version requirements and security identity of the assembly.
Resources - A list of related files, such as.bmp or.jpg files, might be considered a resource. Since these resources are static, they don't change when a programme runs. Resources aren't things that can be run.
Type Metadata - Metadata provides you with further details about an assembly's contents, such as types, type names, method names, etc. The compilers will automatically create metadata
from the source files and include this metadata in the target output files, such as.exe,.dll, or a.netmodule (in the case of multi-module assembly).
The more recent iteration of the.NET Framework is known as.NET Core. It is a free, open-source, general-purpose application development platform that Microsoft offers.
Because it functions on different operating systems, including Windows, Linux, and macOS, it is a cross-platform framework. Applications for the mobile web, IoT, machine learning,
games, cloud, microservices, etc. can be created using this framework.
It has key components that are required for operating a fundamental.NET Core application, such as a cross-platform, sharable library, etc. The remaining functions are offered as NuGet packages,
which you can add to your application in accordance with your requirements. In this way, it is possible to state that the.NET Core will improve application performance, reduce memory
requirements, and make application maintenance simpler. It adheres to the modular approach, allowing your application to install or use only the necessary portions of the.NET Framework
rather than the complete installation.
The IGCToCLR interface, which is utilised for runtime communication, will be supplied as an input to the InitializeGarbageCollector() function. There are numerous built-in methods included in it, like RestartEE() and SuspendEE ().
The payload body—the informational portion of the data sent in the body of an HTTP message—is transferred to the user using transfer-encoding. It is a hop-by-hop header that is
added to a message between two nodes rather than the resource itself. Different Transfer-encoding values can be used in each multi-node connection segment.
Transfer-encoding is set to "Chunked," indicating the start of the Hypertext Transfer Protocol's Chunked encoding mechanism, which sends data in the form of a series of "chunks."
This is useful when there is a lot of data being supplied to the client and it will take some time to process the request before it is apparent how big the response will be overall.
For creating lightweight and extensible applications, use the MEF(Managed Extensibility Framework) library. It enables extension usage by application developers without the requirement for configuration. Additionally, it enables better code encapsulation for extension authors, preventing fragile hard dependencies. You can reuse the extensions both within and between apps thanks to MEF. It is a crucial component of.NET Framework 4. Large applications benefit from improved maintainability, flexibility, and testability.
A runtime called.NET Core is used to run applications that were created for it. ASP.NET Core, on the other hand, is a group of libraries that work together to create a framework
for creating web applications. Both the "Full.NET Framework" and.NET Core support the use of ASP.NET Core libraries.
In general, an application employing ASP.NET Core's tools and libraries is referred to as a "ASP.NET Core Application," which theoretically does not specify whether it was
created for the.NET Framework or.NET Core. Therefore, a "ASP.NET Core Application" can be categorised as either a ".NET Core Application" or a ".NET Framework Application".
Before a programme is run, or at build time, a high-level language is converted into a low-level language via a process called ahead-of-time (AOT) compilation.
The workload at run time is lessened by AOT compilation.
In larger applications where the majority of the code is executed at startup, AOT offers a quicker start-up time. But to retain both IL (Intermediate Language) and precompiled images,
it needs more disc space, memory, or virtual address space. In this scenario, the JIT(Just In Time) Compiler will perform a lot of labor-intensive disc I/O operations.
When the programme is run, the explicit compilation will translate the higher-level language into object code. Before interacting with line-by-line code, ahead of time (AOT)
compilers check to see if the CPU will understand it.
The Angular compiler and HTML templates do not need to be shipped in the bundle because Ahead-of-Time (AOT) compilation only occurs once during build time. Once downloaded into the browser,
the resulting source code can start working right away; earlier procedures are not necessary. The HTML template will be converted into a runnable code snippet via the AOT compilation.
During build time, AOT will evaluate and statically compile our templates.
A developer can create a.NET application and library for.NET 5 (also known as.NET Core) and later versions using the.NET Core SDK, which is a collection of tools and libraries. It consists of the.NET CLI for creating apps, the.NET libraries and runtime for creating and executing apps, and the dotnet.exe (dotnet executable) for executing CLI commands and starting apps.
In.Net, there are two categories of indexes:
Clustered index
Non-clustered index
Language Integrated Query (LINQ) alerts A consistent query syntax in C# and VB.NET for data retrieval from many sources and data modification, regardless of the data source, was introduced with Visual Studio 2008 and is available for both languages.
The process of changing types in managed and unmanaged code is known as marshalling. The most crucial service offered by CLR is this one.
Windows apps are created using the application programme ADO. Additionally, it is used to access databases from relational or non-relational database providers like Microsoft and others.