Top 31 Dot Net Framework Interview Questions
Q1. How To View Assembly Information ?
By the use of Ildasm.Exe, which is an MSIL Disassembler you can still view attributes, references to different modules and assemblies.
Q2. What Is A Private Assembly ?
Private Assemblies are meant to be utilized by the program for which it is made for. Reason in the back of this is that, the software will only load non-public assemblies which can be located in the identical folder or in the sub folder of the main executable.
Q3. What Is Common Language Runtime (clr) ?
Common Language Runtime or CLR is the run-time execution surroundings of .Net Framework. Converting MS-IL into platform or OS precise code is performed via the CLR. Currently, .Net programs will run only on windows.
Q4. What Is An Assembly ?
Assemblies are self-describing logical unit which consists of one or extra files centered at dot internet. An meeting can be stored across single report along with a unmarried DLL or EXE that includes metadata, or it canbe saved in more than one files.
For example, useful resource files like meta statistics, DLL's, and an EXE. Assemblies guide versioning.
Q5. What Are The Different Type Of Jit's ?
Different Types of JIT are:
Pre-JIT - Complies entire supply code into native code on the time of deployment.
Econo-JIT - Complies strategies which can be referred to as at runtime.
Normal-JIT - Complies techniques which are referred to as at runtime and get stored in cache. Next time whilst the identical method is known as, it'll be taken from cache.
Q6. What Is Delay Signing ?
To create a strong named meeting and to make sure that this meeting can utilized by a person else, we partially build this assembly through providing a Public Key. We write this Public Key within the AssemblyInfo.Vb OR .Cs document. We also upload an characteristic by the call <Assembly:AssemblyDelaySignAttribute(true)> to the assembly information document. This makes it certain that when we construct the assembly, it might be containing the information best approximately the public key earlier than we supply it to our customers. This is a partial strong named assembly that we have created, and for this reason it's miles referred to as Delayed Assembly.
Q7. What Is Ms-il (microsoft Intermediate Language) ?
When a software is complied in .Net, the source code can be transformed into an intermediate language called Microsoft Intermediate Language (MS-IL). This is done by Just-In time Compiler (JIT). The dot net framework is built in this type of way that the code is Just-In time complied, which me that it get complied when it's miles called instead of compiling whole code at the start up. A part of the code gets complied most effective as soon as and it's going to exist until the software go out. This will have a sizable improvement in performance since the complete segment of the code won't get finished in maximum instances.
Q8. What Is Global Assembly Cache (gac) ?
While using shared assemblies, to avoid Assembly being overwritten via a distinctive version of the same meeting, shared assemblies are placed in a unique directory subtree of the document machine referred to as the worldwide assembly cache (GAC). Placing shared assemblies can best be completed by a special .Net Utilities.
Q9. What Is Garbage Collector ?
Garbage Collector is utilized in dot internet Framework for memory management. While going for walks an application, packages make a request for reminiscence for its internal use. Framework allocates memory from the heap. Once the process is finished, allocated memory wishes to be reclaimed for destiny use. The procedure of reclaiming unused memory is taken care by using the Garbage Collector.
Q10. Where Is The Assembly Version Information Stored ?
In the Manifest.
Q11. What Is .Internet Framework ?
The .NET framework is a programming framework from Microsoft. Developers can use .Net Framework to develop applications, installation and run the software on Windows running structures.
Q12. What Is Native Image Generator (ngen.Exe) ?
Ngen.Exe creates compiled processor-unique machine code called native photographs which are files and installs them into the local photo cache at the local computer. The runtime will use native photos from the cache in place of the usage of the JIT compiler to bring together the unique meeting.
Q13. Explain The Concept Of Boxing And Unboxing ?
Converting a cost kind to reference type is known as Boxing. Converting a reference kind to fee type is referred to as Unboxing.
Q14. What Is The Difference Between Namespace And Assembly ?
Namespace:
Forms the logical boundary for a Group of lessons.
It is a Collection of names where every call is Unique.
The namespace need to be specified in Project Properties.
Assembly:
Assemblies are Self-Describing
It is an Output Unit. It is a unit of deployment and is used for versioning. Assemblies incorporate MSIL code.
Q15. What Is Assembly Manifest ?
Part of the assembly which contains assembly meta information that describes the meeting itself is known as occur. Assembly happen carries Assembly Name, Version Number, Culture, Strong name, List of documents inside the assembly and Reference records.
Q16. What Is Namespace ?
A namespace is a logical grouping of associated instructions and types. Every class have to have a NameSpace.
Q17. How To Invoke Garbage Collector Programmatically ?
To name rubbish collector from a program, use code “ GC.Collect(); “
Q18. What Is Code Access Security?
CODE Access security is a security model that let us provide or deny execution permissions to an meeting in step with its "homes," referred to as proof, along with its robust call or writer.
Q19. What Is Common Language Specification (cls) ?
Common Language Specification (CLS) is used for Language Interoperability in tandem with CTS to make sure the interoperability of the languages. CLS defines a hard and fast of minimum standards that every one compilers focused on dot internet should assist. For instance, VB.Net is not case sensitive. So characteristic “EmployeeName” and “employeename” is considered same. But C# is case touchy. So for language interoperability, C# doesn't permit two variables which differ best in case.
Q20. What Is Shared Assembly ?
Shared Assemblies comprise Common Libraries which might be intended to be used by a couple of packages. While making shared assemblies, call collisions and overwriting current assemblies want to be taken care. Name Collisions may be taken care by sturdy name. Global assembly cache can be used to avoid assembly overwriting.
Q21. How To Prevent My .Net Dll To Be Decompiled ?
We can prevent .NET DLL to be decompiled upto an extent through Obfuscate Source code, uneven encryption and encrypted w32 wrapper application.
Q22. What Is A Managed Code ?
Managed code is code that may be completed and managed by way of .NET Framework Common Language Runtime. All codes based at the intermediate language(EL) executes as managed code.
Q23. Explain The Concept Of Strong Names ?
While the use of shared assemblies, with the intention to avoid call collisions strong names are used. Strong Names are based totally on personal key cryptography, ie. Non-public assemblies are actually given the identical call as their important report call.
Q24. What Is A Satellite Assembly?
A satellite meeting are used while multilingual (UI) utility are created. Satellite assembly is a compiled library that consists of localized assets which offers us with the capability of designing and deploying solutions to more than one cultures, instead of hard coding texts, bitmaps etc
Q25. What Is Reflection?
Reflection is used to dynamically load a category, create item and invoke techniques at runtime. It can also be used to examine its very own meta records to locate assemblies, modules and type information at runtime.
Q26. What Is Common Type System (cts) ?
.Net uses Common Type System (CTS) for Language Interoperability. CTS defines the predefined facts types which are to be had in IL, so that every one languages that concentrate on the .NET framework will produce the compiled code this is in the long run primarily based on those types. CTS guarantees that a information type described in a VB.Net may be understood through C#. For example, VB.Net makes use of “Integer” to outline the statistics kind Integer. C# makes use of “int” to outline the records kind Integer. When VB.Net code is compiled, it's going to convert the Integer to Int3@Since C# refers Int to Int32, VB.Net code will be understood via C#.
Q27. How To Add And Remove A Assembly From Gac?
To set up meeting in Cache, use Gacutil. To run Gacutil, goto "Visual Studio Command Prompt" and type "gacutil -i <assembly_name>", where (assembly_name) is the DLL name of the undertaking. To uninstall meeting, type gacutil –u <assembly name> in Visual Studio Command Prompt.
Q28. What Are Value Types And Reference Types ?
There are styles of information types in .Net, Value kinds and Reference sorts. Value sorts are stored in stack part of the memory. Reference type are saved in controlled heap. Let have a study the example for better know-how.
Int iCount = 0; Value Type
int NewiCount = iCount; Reference Type
Q29. What Is Code Document Object Model (codedom) ?
Code Document Object Model are code mills that are used to decrease repetitive coding tasks, and to decrease the range of human-generated supply code lines.
Q30. What Are The Different Types Of Assembly ?
The types of Assemblies are Shared and Private.
Q31. What Are The Advantages Of .Internet?
Good Design
Object-Oriented Programming – Using C# and .NET which can be based totally on item-orientated Concepts.
Language Independence – All the languages which are supported via .Net (VB.NET, C#, J#, and controlled C++) are compiled into commonplace Intermediate Language (IL). So IL makes sure that languages are interoperable.
Efficient Data Access – ADO.NET provides fast and green manner to get right of entry to RDBMS, file device and many others.
Code Sharing – To share code among applications, a new idea known as assembly is added. Assemblies supports versioning.
Improved Security
Support Dynamic Web Pages – Using ASP.NET
Support for Web Services

