Pages

Friday, 18 September 2015

C#.Net Interview Questions and Answers

11. How do I simulate optional parameters to COM calls?  
You must use the Missing class and pass Missing.Value (in System.Reflection) for any values that have optional parameters.

12. What do you know about .NET assemblies? 
Assemblies are the smallest units of versioning and deployment in the .NET application. Assemblies are also the building blocks for programs such as Web services, Windows services, serviced components, and .NET remoting applications.

13. What’s the difference between private and shared assembly? 
Private assembly is used inside an application only and does not have to be identified by a strong name. Shared assembly can be used by multiple applications and has to have a strong name.

14. What’s a strong name? 
A strong name includes the name of the assembly, version number, culture identity, and a public key token.

15. How can you tell the application to look for assemblies at the locations other than its own install?
Use the directive in the XML .config file for a given application.
< probing privatePath=c:\mylibs; bin\debug />
should do the trick. Or you can add additional search paths in the Properties box of the deployed application.

16. How can you debug failed assembly binds? 
Use the Assembly Binding Log Viewer (fuslogvw.exe) to find out the paths searched.

17. Where are shared assemblies stored? 
Global assembly cache.

18. How can you create a strong name for a .NET assembly? 
With the help of Strong Name tool (sn.exe).

19. Where’s global assembly cache located on the system? 
Usually C:\winnt\assembly or C:\windows\assembly.

20. Can you have two files with the same file name in GAC? 
Yes, remember that GAC is a very special folder, and while normally you would not be able to place two files with the same name into a Windows folder, GAC differentiates by version number as well, so it’s possible for MyApp.dll and MyApp.dll to co-exist in GAC if the first one is version 1.0.0.0 and the second one is 1.1.0.0.

More Questions & Answers:-

No comments:

Post a Comment