P2Pprogrammer 2 programmer

Home > Interview Question and Answer > C# and VB.Net > .NET Assemblies, Configuration, and Security

.NET Assemblies, Configuration, and Security interview questions and answers

Interview questions and answers for .NET Assemblies, Configuration, and Security. .NET Framework, Assemblies, Configuration, and Security, Metadata, manifest, Satellite assembly, Permission, Strong Name, .NET Framework C#, VB.NET Configuration Interview Question and Answers for .NET Framework Version 2.0, 3.0, 3.5, 4.0, 4.5

.NET Assemblies, Configuration, and Security interview questions and answers

1. Describe how to sign your assembly with a strong name. Why would you want to do this?

To sign your assembly with a strong name, you must have access to a key file or create one with the strong name utility (sn.exe). You then specify the key file in the AssemblyInfo file and verify that the version number is correct. The assembly will be signed with a strong name when built. In addition to identifying your assembly and ensuring version identity, a strong name is required if you want to install your assembly to the Global Assembly Cache.

2. Describe how to use code to retrieve resources at run time.

You must first create an instance of the ResourceManager class that is associated with the assembly that contains the desired resource. You can then use the GetString method to retrieve string resources or the GetObject method to retrieve object resources.

3. Explain how to retrieve information from the configuration file at run time. How would you store information in the configuration file at design time?

You must first create an instance of AppSettingsReader to read the configuration file. You can then call the GetValue method to read values represented in the configuration file. To add configuration file entries, you should create <add> elements in the <appSettings> node of the configuration file. In the <add> element, you should specify a value for the entry and a key that can be used to retrieve the entry. The value can be changed between executions of the application.

4. You are creating a solution that must be accessed by members of a group called Developers and Administrators on the local machine. Describe a plan to implement this security scheme.

Create one PrincipalPermission that represents the Developers group and another PrincipalPermission that represents the BUILTIN\Administrators group. Then, create a third permission that represents the union of the two by calling the Union method and demand that permission.

5. Briefly highlight the differences between imperative and declarative security as they pertain to code access security

Imperative security is implemented by calling methods of Permission objects in code at run time. Declarative security is configured by attaching attributes representing permissions to classes and methods. Imperative security allows a finer control over the point in execution where permissions are demanded, but declarative security is emitted into metadata, and required permissions can be discovered through the classes in the System.Reflection namespace. Additionally, you can request assembly-wide permissions using the Assembly (assembly) directive with declarative security.

6. What is a shared assembly? How would you create one?

An assembly is an assembly of which only a single copy is installed per machine. This copy can be shared by multiple applications. To make an assembly a shared assembly, you must first assign it a strong name, and then install it to the global assembly cache.

7. What is Assemblies?

Assemblies are the fundamental building blocks of a .NET Framework application. They contain the types and resources that make up an application and describe those contained types to the common language runtime. Assemblies enable code reuse, version control, security, and deployment.

8. What is assembly manifest?

assembly manifest The metadata for the assembly. It contains all of the information needed to describe the assembly to the common language runtime

9. What is Authenticated and Authorization?

authentication The process of determining the identity of a user. In effect, authentication validates that the users are who they say they are
authorization The process of allowing access to an application or resource based on credentials supplied by the user

10. What is satellite assembly?

satellite assembly When localizing an application, assemblies that contain alternate sets of resources to be used in the application for different cultures.

More C# and VB.Net Interview Question and Answers

  1. .NET Framework interview questions and answers
  2. VB.NET and C# User Interface interview questions and answers
  3. .NET Object-Oriented Programming (OOPs) interview questions and answers
  4. ADO.NET interview questions and answers
  5. Advanced .NET Framework Topics interview questions and answers
  6. Windows Service, COM+ and XML Web Services interview questions and answers
  7. .NET Assemblies, Configuration, and Security interview questions and answers
  8. VB.NET and C# setup and deployment interview questions and answers
  9. VB.NET and C# general interview questions and answers

Home > Interview Question and Answer > C# and VB.Net > .NET Framework