What is CLR?
.NET Interview Questions and Answers
(Continued from previous question...)
What is CLR?
Answer 1:
CLR(Common Language Runtime) is the main resource of .Net Framework. it is collection of services like garbage collector, exception handler, jit compilers etc. with the CLR cross language integration is possible.
Answer 2:
The .NET Framework provides a runtime environment which runs the code and provides services that make the development process easier. This runtime environment in .NET Framework is known as Common Language Runtime (CLR). The CLR sits at the very heart of managed code. Common Language Runtime is the generalized multi-language, reflective execution engine on which code originally written in various languages runs. At a higher level, CLR is simply an engine that takes in Intermediate Language (IL) instructions, translates them into machine instructions, and executes them. Although the common language runtime provides many standard runtime services, managed code is never interpreted. A feature called just-in-time (JIT) compiling enables all managed code to run in the native machine language of the system on which it is executing. The CLR shares much in common with a traditional operating system.
Quote:
Managed code is the term used for any code that is running on .NET Framework.
The CLR provides the infrastructure that enables managed code to execute as well provides variety of services during execution. When a method, for which IL has been generated, is called for the first time the CLR compiles the IL into native code that is specific to the processor the Environment it is running on (This process is known as Just in Time Compilation or JIT). If the same method is called next time, the existing JIT compiled code is reused. During execution managed code receives variety of services from the runtime environment.
Quote:
When compiling to managed code, the compiler translates your source code into Microsoft intermediate language (MSIL), which is a CPU-independent set of instructions that can be efficiently converted to native code. Intermediate Language is a binary assembly language that is compiled at runtime down to whatever machine language is appropriate for the host CPU. This runtime compilation is called Just-In-Time Compiling or JIT-compiling.
Advantages of Managed Execution Environments
In unmanaged environments the compiler and linker directly compile the source code in to native instructions that are targeted at a specific processor. The disadvantage of this process is that each time you want to run your executable on a different platform you will have to re-compile the code using a compiler and linker that will compile the code that is targeted at the specific hardware. This means that each time you want your application to run on a different platform, you will have to ship the compiled instructions again and again. As this leads to compiling and maintaining multiple versions of the same application, the companies try to create a more generalized compiled version in order to target most of the environments. This process is known as the Lowest Common Denominator approach. This leads to a more generalized program which is not optimized properly and does not take advantages of the underlying hardware infrastructure (processor, cache, etc). Because the CLR supplies one or more Just in Time Compiler for each computer architecture it supports, the same set of MSIL can be JIT-compiled and run on any supported architecture. This
CLR provides the following benefits for developers:
Vastly simplified development.
Seamless integration of code written in various languages.
Evidence-based security with code identity.
Assembly-based deployment that eliminates DLL Hell.
Side-by-side versioning of reusable components.
Code reuse through implementation inheritance.
Automatic object lifetime management.
Code access security.
Cross Language Integration.
Self describing objects.
The CLR automatically handles object layout and manages references to objects, releasing them when they are no longer being used. This automatic memory management resolves the two most common application errors, memory leaks and invalid memory references. This process is known as Garbage Collection. The CLR also manages thread execution, code execution, code safety verification, compilation, and other system services.
The CLR is designed for the software of the future, and it also supports software of today and yesterday. Interoperability between managed and unmanaged code provided by CLR helps developers continue to use necessary COM components and DLLs.
(Continued on next question...)
Other Interview Questions
- What is .NET?
- How many languages .NET is supporting now?
- How is .NET able to support multiple languages?
- How ASP .NET different from ASP?
- What is smart navigation?
- What is view state?
- How do you validate the controls in an ASP .NET page?
- Can the validation be done in the server side? Or this can be done only in the Client side?
- How to manage pagination in a page?
- What is ADO .NET and what is difference between ADO and ADO.NET?
- Observations between VB.NET and VC#.NET?
- Advantages of migrating to VB.NET ?
- Advantages of VB.NET
- Using ActiveX Control in .Net
- What is Machine.config?
- What is Web.config?
- What is the difference between ADO and ADO.NET?
- What is the difference between VB and VB.NET?
- What is a Strong Name?
- What is a Manifest?
- Creating a Key Pair?
- What is the difference between "using System.Data;" and directly adding the reference from "Add References Dialog Box"?
- What is GAC?
- What is a Metadata?
- What is managed code and managed data?
- What is .NET / .NET Framework?
- What is Reflection?
- What is "Common Type System" (CTS)?
- What is "Common Language Specification" (CLS)?
- What is "Common Language Runtime" (CLR)?
- What are Attributes?
- What are the Types of Assemblies?
- What is an Intermediate language?
- ASP.NET Authentication Providers and IIS Security
- What is the difference between ASP and ASP.NET?
- Using COM Component in .Net
- What is an assembly?
- What is a Web Service?
- webFarm Vs webGardens
- What is the difference between a namespace and assembly name?
- What’s a Windows process?
- What’s typical about a Windows process in regards to memory allocation?
- Explain what relationship is between a Process, Application Domain, and Application?
- What are possible implementations of distributed applications in .NET?
- What are the consideration in deciding to use .NET Remoting or ASP.NET Web Services?
- What’s a proxy of the server object in .NET Remoting?
- What are remotable objects in .NET Remoting?
- What are channels in .NET Remoting?
- What security measures exist for .NET Remoting in System.Runtime.Remoting?
- What is a formatter?
- Choosing between HTTP and TCP for protocols and Binary and SOAP for formatters, what are the trade-offs?
- What’s SingleCall activation mode used for?
- What’s Singleton activation mode?
- How do you define the lease of the object?
- Can you configure a .NET Remoting object via XML file?
- How can you automatically generate interface for the remotable object in .NET with Microsoft tools?
- What is Delegation?
- What is "Microsoft Intermediate Language" (MSIL)?
- Differences between Datagrid, Datalist and Repeater?
- I am constantly writing the drawing procedures with System.Drawing.Graphics, but having to use the try and dispose blocks is too time-consuming with Graphics objects. Can I automate this?
- How do you trigger the Paint event in System.Drawing?
- With these events, why wouldn’t Microsoft combine Invalidate and Paint, so that you wouldn’t have to tell it to repaint, and then to force it to repaint?
- How can you assign an RGB color to a System.Drawing.Color object?
- What class does Icon derive from? Isn’t it just a Bitmap with a wrapper name around it?
- Before in my VB app I would just load the icons from DLL. How can I load the icons provided by .NET dynamically?
- When displaying fonts, what’s the difference between pixels, points and ems?
- What is the difference between VB 6 and VB.NET?
- What are the authentication methods in .NET?
- What is Serialization in .NET?
- What’s the use of System.Diagnostics.Process class?
- Difference Abstract class and Interface
- re-clarification of object based:
- How to achieve Polymorphism in VB.Net?
- Difference between Class And Interface
- What doesu mean by .NET framework?
- What is assembly?
- What is namespaces?
- NET framework overview
- What is the base class of .NET?
- Explain assemblies.
- Name some of the languages .NET support?
- ADO.NET features? Benefits? Drawbacks?
- How many types of exception handlers are there in .NET?
- Difference between Panel and GroupBox classes?
- What is the base class of Button control?
- What is Response object? How is it related to ASP’s Response object?
- What is IIS? Have you used it?
- Main differences between ASP and ASP.NET.
- What are the advantages and drawbacks of using ADO.NET?
- Why The JavaScript Validation Not Run on the Asp.Net Button But Run SuccessFully On The HTML Button
- what is the difference between user control an custom control? advantages/disadvantages?
- What’s the difference between Response.Write() andResponse.Output.Write()?
- What is the use of ErrorProvider Control?
- What is CLR?
- What is Delegate and what is it used for ?
- How is meant by DLL ?
- Which DLL translate XML to SQL in IIS?
- Can anyone tell me about Secure Socket Layer? How to make use of the technology?
- What is the Differnce Between Response.write & response.output.Write
- Which dll is required to translate XML to SQL in IIS ?
- What is an interface and what is an abstract class? Please, expand by examples of using both. Explain why.
- What is serialization, how it works in .NET?
- What should one do to make class serializable?
- What exactly is being serialized when you perform serialization?
- How does output caching work in ASP.NET?
- What is connection pooling and how do you make your application use it?
- What are different methods of session maintenance in ASP.NET?
- What is Viewstate?
- Can any object be stored in a Viewstate?
- What should you do to store an object in a Viewstate?
- Explain how Viewstate is being formed and how it’s stored on client.
- What do you know about ADO.NET’s objects and methods?
- Explain DataSet.AcceptChanges and DataAdapter.Update methods.
- When we go for html server controls and when we go for web server controls?
- ASP.NET interview questions only (1)
- ASP.NET interview questions only (2)
- ASP.NET interview questions only (3)
|