.NET Framework Interview Questions and Answers (547) - Page 19

What is CAS ?

CAS is Code Access Security.
It is a part of the .NET security model which prevents the unauthorized access of resources and operations, and restricts the code to perform particular tasks.
How can you turn-on and turn-off CAS ?

You can use the Code Access Security Tool (Caspol.exe) to turn security on and off.

To turn off security, type the following command at the command prompt:
caspol -security off

To turn on security, type the following command at the command prompt:
caspol -security on

In the .NET Framework 4.0, for using Caspol.exe, you first need to set the <LegacyCasPolicy> element to true.
How can you instantiate a tuple ?

The following are two ways to instantiate a tuple:

1) Using the new operator
Example:

Tuple<String, int> t = new Tuple<String, int> ("Hellow", 2);


2) Using the Create factory method available in the Tuple class.
Example:

Tuple<int, int, int> t = Tuple.Create<int, int, int> (2, 4, 5);

What is WCF Data services?

WCF Data services technology is used to create a service by using Open Data Protocol (oData). This service is used to exposes and consumes data over the web or intranet by using the semantics of representational state transfer (REST).
what are differences between linq to sql and entity framework

Linq to Sql
--------------------
1) Its only works with Sql server.
2) Used for rapid application development.
3) It does not support for complex type.
4) It can't generate db from model.
5) Mapping type ( class to single table)
6) We can query data using DataContext.

Entity framework
--------------------
1) Its works with variety of db products.
2) Can not used for rapid application development.
3) It provides support for complex type.
4) It can generate db from model.
5) Mapping type ( class to multiple tables)
6) We can query data using esql,object services,entity client and linq to entities.
Statement that is used to replace multiple if Statement is Called :

NOTE: This is objective type question, Please click question title for correct answer.
Which OS does the .NET Framework run on?

NOTE: This is objective type question, Please click question title for correct answer.
Which is the most important component of the framework?

NOTE: This is objective type question, Please click question title for correct answer.
Where are Shared Assemblies stored?

NOTE: This is objective type question, Please click question title for correct answer.
What is the caspol.exe tool used for ?

The caspol tool is used to grant and modify the permissions to code groups at the user policy, machine policy, and enterprise policy levels.
What is Ilasm.exe used for ?

Ilasm.exe is a tool that generates PE(portable executable) files containing the MSIL code as a parameter and creates a text file that contains managed code.
You can run the resulting executable to determine whether the MSIL code performs as expected.
What is the ResGen.exe tool used for ?

ResGen.exe is a tool which is used to convert the resource files in the form of .txt or .resx files to common language runtime binary .resources files.
These files can be compiled into satellite assemblies.
What is metadata?

Metadata is the binary information that describe your program and it is stored in PE (Portable Executable) file or in memory.
Metadata stores:

1) Description of assembly
2) Description of types
3) Attributes
What is CTS?

CTS stands for common type system. It is the subset of CLR. It provides common types for all dot net languages so that one language can understand other language. It has some conventions to convert objects from one language to other language.

Example:

in VB numeric values are identified by Integer data type whereas in C# it identified by int data type but CTS provides system.int32 for all dot net compatible languages.
What is a Web Service?

Web services are application components that communicates using open protocols.
web services can be discovered using UDDI (Universal Description Discovery and Integration). Webservice is used to communicate between two same or different applications.

The basic web service plateform is xml and http. XML is the language which is used between different platform and programming languages.

HTTP (Hypertext Transfer Protocol) is the used by most of the browsers.
What is Global Asssembly Cache (GAC)?

GAC global assembly cache is the place where your shared assemblies are stored. When you create a assembly and make it to share with all oter applications, you need to install that assembly in GAC by using following command:

gacutil -i "assembly name with path"
What is Machine.config?

It is a configuration file that contains setting for entire computer. It also contains the settings for machine wide assembly binding, built in remoring channels and ASP.net. It can be found in
.net framework install directory\framework\<version>\config

Example:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG
What is an application domain ?

Application domain is nothing but a boundary within which an application runs. A process can contain multiple application domains. Application domains provide an isolated environment to applications that is similar to the isolation provided by processes. An application running inside one application domain cannot directly access the code running inside another application domain. To access the code running in another application domain, an application needs to use a proxy.
How does an AppDomain get created ?

AppDomains are usually created by hosts (Windows Shell, ASP.NET and IE).
When you run a .NET application from the command-line, the host is the Shell. The Shell creates a new AppDomain for every application. AppDomains can also be explicitly created by .NET applications.
What is a dynamic assembly ?

An assembly which is created dynamically at run time, when an application requires the types within these assemblies is nothing but a dynamic assembly.
Found this useful, bookmark this page to the blog or social networking websites. Page copy protected against web site content infringement by Copyscape

 Interview Questions and Answers Categories