Professional Documents
Culture Documents
1. What are the difference between Value Types and Reference types?
Ans: Value types are those that are created on the stack. Reference types are
created on the heap. Value types are destroyed when the block creating them is
exited. Reference types are garbage collected. Reference types are like pointers.
3. What are three to five important differences that you would find between
COM/DCOM and .NET?
Ans:
1. COM/DCOM uses the registry to store all information related to the
component. And .NET stores the information within the component itself
2. All COM/DCOM components must be installed. .NET components can
simply be xcopied (even though shared assemblies would need to be installed
with gacutil.exe)
3. COM/DCOM components implement the interface IUnknown (that has the
methods: AddRef(), Release() and QueryInterface()) All .NET components
inherit from the CTS type System.Object
4. COM/DCOM is not type-independent. For example, all COM server methods
in VB must accept or return variants. In .NET, since all languages share the
same type library (CTS – Common Type System) - this overhead is removed.
5. DCOM uses a proprietary mechanism to discover remote objects, marshall the
parameters and return back values. .NET uses open standards like XML to do
remoting.
6. COM/DCOM depends on reference counts to know if they are needed. In
.NET, the garbage collector takes care of keeping object lifetimes and
collecting them when no longer needed.
5. What does Shared Assembly mean? Can you make any assembly a shared
one?
Ans: Shared Assemblies are those that are installed in a special folder within the
Windows installation (called Global Assembly Cache). They can be used by
any .NET application that needs to be a client to the assembly's methods. To make
an assembly into a shared one, you need to generate a strong name. For this you
have SN.EXE that generates public and private keys that can be used to version
and strongly name the assembly in the GAC. Unless this is done, any and every
assembly cannot become shared.
1
2
8. What are three to five differences you would state, between ASP and
ASP.NET ?
Ans:
1. In ASP all the page contents are in the same file (or in included files). In
ASP.NET, you can split the page's content and code into separate files (the
code-behind file)
2. ASP files end with .asp. ASP.NET files end with .aspx (this is dumb )
3. With ASP you had just two main languages to write code – VBScript and
JScript. With ASP.NET you can write code in any language that has a .NET
compiler installed on the IIS server
4. All ASP pages are interpreted. ASP.NET uses compilation of the code-behind
and runs the binaries everytime the page is requested.
5. ASP.NET adds a lot of functionality to IIS – like server controls, user
controls, improved session management, event driven programming etc.
6. ASP pages usually post their forms to other asp pages. ASP.NET pages post
the forms back to the same page (by calling server methods)
9. What are delegates in .NET? Mention 2 places where they are majorly used
Ans: Delegates are objects representing function pointers. Whenever a delegate is
created, it is given the name of a function of the type it is defined with (like void
return, accepting an int). Invoking the delegate calls the method it was created
with (sort of a callback mechanism). Two places where delegates are employed:
Events and Threads.
2
3
13. Are you aware of a keyword called fixed in C#? What is it used for?
Ans: The fixed keyword is used with references defined in a class. Whenever the
word fixed is encountered, the .NET runtime/CLR flags this particular object on
the heap.So that the garbage collector will not move it when it compacts the heap.
Using fixed allows you to perform pointer arithmetic on objects (unsafe code)
16. Can you have a catch block with no parameters (no catch (Exception e) ?
Ans: Yes. When you define a catch block with no parameters, you are defining a
block that will handle exceptional information from the non .NET world. This
would take care of problems arising in method calls on COM components that
don’t raise the System.Exception derived object.
3
4
the thread, it runs the delegate method parallel with the current thread of
execution.
20. What is the mechanism used to peep inside an object and know about its
methods, public members etc?
Ans: Reflection. It is possible as all types inherit from System.Object, that
contains a method GetType that returns a Type structure, describing the object's
type.
22. Can you have two files in the same assembly, created with different
programming languages?
Ans: Yes. .NET allows this.
23. Can you have a page where the code behind uses two different .NET
languages?
Ans: No. Every page or class in .NET must be created in the same language.
4
5
You can make the root web folder publicly accessible, while restricting access
to subfolders or selected files
3. Web-Service based: Microsoft runs a Passport web service that has a single
door entry to authenticate users. Web applications could utilize this service to
identify and permit users to access the system.
5
6
The Microsoft .NET Framework SDK tools are designed to make it easier for you to
create, deploy, and manage applications and components that target the .NET
Framework. This section contains detailed information about the tools.
You can run all the tools from the command line with the exception of the Assembly
Cache Viewer (Shfusion.dll) and the Microsoft CLR Debugger (DbgCLR.exe). You
must access Shfusion.dll from Microsoft Windows Explorer. DbgCLR.exe is located
in the Microsoft.NET\FrameworkSDK\GuiDebug folder.
Tool Description
Assembly Cache Viewer (Shfusion.dll) Allows you to view and manipulate the
contents of the global assembly cache using
Windows Explorer.
Assembly Linker (Al.exe) Generates a file with an assembly manifest
from one or more files that are either
resource files or Microsoft intermediate
language (MSIL) files.
Assembly Registration Tool (Regasm.exe) Reads the metadata within an assembly and
adds the necessary entries to the registry,
which allows COM clients to create .NET
Framework classes transparently.
Assembly Binding Log Viewer Displays details for failed assembly binds.
(Fuslogvw.exe) This information helps you diagnose why
the .NET Framework cannot locate an
assembly at run time.
Global Assembly Cache Tool (Gacutil.exe) Allows you to view and manipulate the
contents of the global assembly cache and
download cache. While Shfusion.dll
provides similar functionality, you can use
Gacutil.exe from build scripts, makefile
files, and batch files.
Installer Tool (Installutil.exe) Allows you to install and uninstall server
resources by executing the installer
components of a specified assembly.
Isolated Storage Tool (Storeadm.exe) Lists or removes all existing stores for the
currently logged-on user.
Native Image Generator (Ngen.exe) Creates a native image from a managed
assembly and installs it in the native image
cache on the local computer.
.NET Framework Configuration Tool Provides a graphical interface for
(Mscorcfg.msc) managing .NET Framework security policy
6
7
Debugging Tools
Tool Description
Microsoft CLR Debugger (DbgCLR.exe) Provides debugging services with a
graphical interface to help application
developers find and fix bugs in programs
that target the runtime.
Runtime Debugger (Cordbg.exe) Provides command-line debugging services
using the common language runtime Debug
API. Used to find and fix bugs in programs
that target the runtime.
7
8
Security Tools
Tool Description
Certificate Creation Tool (Makecert.exe) Generates X.509 certificates for testing
purposes only.
Certificate Manager Tool (Certmgr.exe) Manages certificates, certificate trust lists
(CTLs), and certificate revocation lists
(CRLs).
Certificate Verification Tool (Chktrust.exe) Verifies the validity of a file signed with an
X.509 certificate.
Code Access Security Policy Tool Allows you to examine and modify
(Caspol.exe) machine, user, and enterprise-level code
access security policies.
File Signing Tool (Signcode.exe) Signs a portable executable (PE) file with an
Authenticode digital signature.
Permissions View Tool (Permview.exe) Displays the minimal, optional, and refused
permission sets requested by an assembly.
You can also use this tool to view all
declarative security used by an assembly.
PEVerify Tool (PEverify.exe) Performs MSIL type safety verification
checks and metadata validation checks on a
specified assembly.
Secutil Tool (Secutil.exe) Extracts strong name public key information
or Authenticode publisher certificates from
an assembly, in a format that can be
incorporated into code.
Set Registry Tool (Setreg.exe) Allows you to change the registry settings
for the Software Publishing State keys,
which control the behavior of the certificate
verification process.
Software Publisher Certificate Test Tool Creates, for test purposes only, a Software
(Cert2spc.exe) Publisher's Certificate (SPC) from one or
more X.509 certificates.
Strong Name Tool (Sn.exe) Helps create assemblies with strong names.
Sn.exe provides options for key
management, signature generation, and
signature verification.
General Tools
Tool Description
Common Language Runtime Minidump Creates a file containing information that is
Tool (Mscordmp.exe) useful for analyzing system issues in the
runtime. The Microsoft Dr. Watson tool
(Drwatson.exe) invokes this program
8
9
automatically.
License Compiler (Lc.exe) Reads text files that contain licensing
information and produces a .licenses file that
can be embedded in a common language
runtime executable.
Management Strongly Typed Class Allows you to quickly generate an early-
Generator (Mgmtclassgen.exe) bound class in C#, Visual Basic, or JScript
for a specified Windows Management
Instrumentation (WMI) class.
MSIL Assembler (Ilasm.exe) Generates a PE file from Microsoft
intermediate language (MSIL). You can run
the resulting executable, which contains
MSIL code and the required metadata, to
determine whether the MSIL code performs
as expected.
MSIL Disassembler (Ildasm.exe) Takes a PE file that contains MSIL code and
creates a text file suitable as input to the
MSIL Assembler (Ilasm.exe).
Resource File Generator Tool (Resgen.exe) Converts text files and .resx (XML-based
resource format) files to .NET common
language runtime binary .resources files that
can be embedded in a runtime binary
executable or compiled into satellite
assemblies.
Windows Forms ActiveX Control Importer Converts type definitions in a COM type
(Aximp.exe) library for an ActiveX control into a
Windows Forms control.
Windows Forms Class Viewer (Wincv.exe) Finds managed classes matching a specified
search pattern, and displays information
about those classes using the Reflection
API.
Windows Forms Resource Editor Allows you to quickly and easily localize
(Winres.exe) Windows Forms forms.