The Obsolete attribute, which is used to specify a method as obsolete, is provided with the .NET framework.
Trang 1Question Bank
Adv Net and Security in Net Project
1. The Obsolete attribute, which is used to specify a method as obsolete,
4. In NET, a dynamic link library is created by default when a project of
type console application is built
7. When a program is compiled into a release version, it has fewer
overheads and also executes faster compared to a debug version
[0.5]
Trang 28. Windows DLLs have deployment problems like registering the DLL in
the Windows registry and versioning issues [0.5]
9. The code residing inside the Windows Dll is known as _
code as it has direct access to the memory
[0.5]
10 Symbol definition should occur the program [0.5]
11 The Win32 API consists of a set of dlls that contain the necessary
methods for invoking the system calls
[0.5]
12 The _ attribute is used to conditionally prevent or allow
execution of a block of code
[0.5]
13 An attribute in C# is a declarative tag, which can be used to provide
information to the runtime about the behaviour of the C# elements
such as classes only
[1.0]
14 Statement 1: An obsolete method executes as any normal method.
Statement 2: Specifying a method as obsolete makes the C# compiler
generate an error when the program is compiled
[1.0]
a) Statement 1 is true c) Statement 2 is true
b) Statement 1 is false d) Statement 2 is false
Trang 315 Which of the following are the steps involved in creating an attribute? [1.0]
a) Enclose the attribute in square
brackets c) Multiple attributes for a singlemethod can be specified by
specifying them one afteranother just before themethod name or classelement they apply to
b) Pass any number of
parameters required to the
attribute within parenthesis
d) All of the above.
a) The DllImport attribute is used
to interoperate with code in
unmanaged and legacy
components
c) The methods contained
within Windows DLLs can becalled within C# programs using the DllImport attribute
b) The unmanaged code is the
code that has been generated
outside the NET environment
d) All of the above.
17 Which namespace has to be imported in applications for working with
legacy code?
[1.0]
a) System.Runtime.Services c) System.Services
b) System.InteropServices d) System.Runtime.InteropServices
18 Which of the following is true when the first parameter passed to
AttributeUsage attribute is AttributeTargets.All enumerator? [1.0]
a) The attribute can be applied
to any class element.
c) The attribute can be applied
Trang 419 Which of the following is true when the first parameter passed to
AttributeUsage attribute is AttributeTargets.Constructor enumerator? [1.0]
a) The attribute can be applied to
any class element
c) The attribute can be applied
only to Enums
b) The attribute can be applied
only to constructors d) The attribute can be applied only to Modules
20 Which of the following is true when the first parameter passed to
AttributeUsage attribute is AttributeTargets.Module enumerator? [1.0]
a) The attribute can be applied to
any class element
c) The attribute can be applied
21 Statement 1: The AllowMultiple property for the AttributeUsage
attribute indicates whether the attribute may be applied to the same
item more than once
Statement 2: The Inherited property for the AttributeUsage attribute
indicates whether the attribute applied to a certain class or interface
applies to all inherited classes or interfaces
[1.0]
a) Statement 1 is true c) Statement 2 is true
b) Statement 1 is false d) Statement 2 is false
22 Which of the following is/are true regarding the AttributeUsage
a) If the Inherited property is
set to true, the attribute
applied to a certain class or
interface will be applied to
all inherited classes or
interfaces.
c) If the AllowMultiple property is set to false, the compiler will generate an error if the attribute is applied to the same item more than once.
b) If the Inherited property is set
to false, the attribute applied to
a certain class or interface will
d) If the AllowMultiple property
is set to true, the compiler will generate an error if the
Trang 5be applied to all inherited
classes or interfaces attribute is applied to the same item more than once
23 Statement 1: To read MetaData from a NET component, the assembly
is first loaded into the running process
Statement 2: Assembly.Load(assemblyName) is a static member
method of the Assembly namespace
[1.0]
a) Statement 1 is true c) Statement 2 is true
b) Statement 1 is false d) Statement 2 is false
a) The NET components expose
their MetaData through a
process known as Reflection
c) The classes necessary for
Reflection can be found in the Namespace
System.Reflection
b) Reflection covers the
various NET base classes
allowing finding out information
about the types in programs or
assemblies
d) All of the above.
25 Which of the following is/are true in relation with the features of
a) As assemblies are
Self-Describing, they do not
require registry keys.
d) The installation of one
application does have adverse effects on the other applications
b) Due to Versioning, each
assembly file reflects or
rather exposes the version
number to all NET
applications.
e) All of the above.
c) Installation of applications
are as simple as copying the
files from one directory to
another.
Trang 626 Consider the snippet given below:
static void Main(string[] args)
Console.WriteLine("The attribute value is :" + ob.ToString());
Which of the following is/are true?
[1.5]
a) The code above will give a
compile time error
c) The code above will give a
run time error
b) The code above will display
the parameter value passed
to attribute existing in the
class AttrEx on console.
d) None of the above.
27 Consider the snippet below:
public class CoderAttribute : Attribute
{
private string cname;
public CoderAttribute(string cName){
this.cname =cName;
}}
Which of the following is/are true regarding the snippet?
[1.5]
a) It is mandatory for
CoderAttribute class to
inherit the Attribute class.
c) It is not necessary for the
CoderAttribute class to have
a constructor defined within it
b) Attribute class belongs to
the System namespace.
d) If the Coder attribute has a
single parameter of string type, then the CoderAttribute
Trang 7class can have a constructor with any number of string parameter.
28 Consider the snippet given below
a) The compiler appends the
string ‘Attribute’ to the name
CoderAttribute forming the
name CoderAttributeAttribute
c) CoderAttribute is the only custom attribute defined for the method
CalculateBonus.
b) The compiler does not
append the string ‘Attribute’
to the name but leaves the
name as CoderAttribute.
d) All of the above.
29 Which of the following snippet is correct for the class WriterAttribute
with the attribute “Writer” that can be applied only to the properties? [1.5]
Trang 8public class WriterAttribute : Attribute{
….
30 Which of the following is the correct syntax, if there are two attributes
associated with a method?
d) …
MethodName(AttributeName1(Parameters)
AttributeName2(Parameters))
[ //Method Implementation ]
a) A NET component is a
piece of executable code
d) The CLR can only execute code in assemblies.
Trang 9referred to as Assemblies.
b) An assembly is a collection
of all information required
by the runtime to execute
an application.
e) All of the above
c) An assembly can be only a
DLL file
32 Consider the snippet below:
[DllImport("Calculation.dll")]
public static extern int Addition(int a, int b);
static void Main(string[] args) {
int ans = Addition(5,2);
Calculation.dll must exist either
in the application directory or
System32 folder inside the
Windows installation directory
d) The Addition method,
imported from the Calculation.dll, takes in two integer parameters and returns the result as an integer
b) The DLL to import is passed
as the parameter to the
DllImport attribute
e) The extern keyword in the
declaration of imported method is necessary for using any external methods residing in Dlls
c) All of the above.
a) An assembly that has been
compiled into a PE file has
an extension of exe.
d) The assembly handles versioning and security permissions.
Trang 10b) The *.exe file in .NET
Framework is the same as a
standalone executable created
by a C++ compiler
e) All of the above.
c) The PE assembly consists of
code in the form of IL that
requires the NET platform to
be installed on the system in
a) The Conditional attribute
marking the Msg() method
ensures that the Msg()
method will be used only in
debug versions of the
solution.
d) The compiler will not
generate an error if the method Msg() does not return a void
b) The calls to the Msg()
method from anywhere in
the code in the release
version will not be
entertained.
e) All of the above.
c) The Msg() method is not called
in the Release version, but
compile time errors are thrown
35 Which of the following is/are true regarding the conditional attribute? [2.0]
Trang 11a) It can only be applied to a
complete method as a unit.
c) If the condition is met, the compiler ignores any lines
of code anywhere else in the source file that calls up the method.
b) If the condition is not met,
the compiler will not compile
the code for the method.
a) Statement 1 is true c) Statement 2 is true
b) Statement 1 is false d) Statement 2 is false
37 Statement 1: Attributes can also be applied to individual arguments of
a method
Statement 2: Attribute name can be declared anywhere with respect to
the definition of the item in the code
[2.0]
a) Statement 1 is true c) Statement 2 is true
b) Statement 1 is false d) Statement 2 is false
38 Which of the following statements is/are true regarding the attribute
DllImport?
Statement 1: It is used to mark a method as being defined in an
external Dll rather than in any assembly
Statement 2: It is used to mark a method as being defined in any
assembly
[2.0]
a) Statement 1 is true c) Statement 2 is true
b) Statement 1 is false d) Statement 2 is false
39 Which of the following is/are true regarding the Conditional attribute? [2.0]
Trang 12a) Any method that returns a
void can be marked with it.
d) It is used to mark a method
as being defined in anexternal Dll
b) It is used to give conditional
compilation.
e) All of the above.
c) It can be used for debug
builds.
40 Which of the following is/are true regarding Reflection?
Statement 1: It allows finding out information about the types in
programs or assemblies
Statement 2: It can be used to read meta data from assembly
manifests
[2.0]
a) Statement 1 is true c) Statement 2 is true
b) Statement 1 is false d) Statement 2 is false
41 Which of the following is/are true?
Statement 1: The Assembly class allows access to the metadata for a
given assembly
Statement 2: The Assembly class provides methods to allow execute
an assembly, which is an executable file
[2.0]
a) Statement 1 is true c) Statement 2 is true
b) Statement 1 is false d) Statement 2 is false
42 Which of the methods is/are used to load the corresponding assembly
into the running process?
Trang 13a) The above method runs if a
debug build takes place c) It gives error during compilation
b) It is an obsolete method d) On using the method the
compiler generates a warning.
44 Consider the snippet given below:
…
class ExClass
{
[Conditional(“Using42.dll”)]
public static extern int MessageBox(int hparent, string
Message, string caption, int type);
b) The code above compiles
successfully
d) The MessageBox() API
function is defined in Using42.dll
45 Which of the following is/are true regarding the windows API function
a) While using the DllImport
attribute, the declaration of the
d) The fourth parameter of the
method if set to 0, ensures
Trang 14method MessageBox must
contain the keyword extern that the message box has a button OK
b) The second parameter of the
method indicates a string or
message to be displayed
e) All of the above
c) The third parameter of the
method indicates a caption to
be displayed in title bar
a) The Assembly.GetTypes()
returns an array of type
System.Type containing objects
that contain the details of all the
types defined in the assembly.
d) The
Assembly.GetAttributes()
is used to get the customattributes attached to an assembly
b) The Assembly.GetTypes() is used
to return an array of System.Type
references that contains details of
only one type
e) All of the above.
used to indicate the items
that the custom attribute can
be applied to.
c) An attribute applied to an
assembly can be placed anywhere in the code but need not be marked with the keyword assembly
b) An attribute can be applied
to an assembly as a whole
instead of to an element in
the code.
d) An attribute applied to an assembly can be placed anywhere in the code but must be marked with the
Trang 15keyword assembly.
a) Assemblies include metadata
such as the types exported
from the assembly and a
manifest
c) NET allows different
versions of the same assembly to be used in a single process
b) The version of a referenced
assembly is stored in the
manifest of the assembly
d) All of the above.
49 Statement 1: Application Domains allow applications to run
independently inside a single process
Statement 2: Application Domains do not allow applications to run
independently inside a single process
[2.5]
a) Statement 1 is true c) Statement 2 is true
b) Statement 1 is false d) Statement 2 is false
50 Statement 1: Private assemblies require registration and versioning.
Statement 2: Private assemblies can have versioning problems, which
need to be addressed during development time
Statement 3: Windows 2000 introduced the side-by-side feature that
allows different versions of the same DLL to be used on a system
[2.5]
a) Only statements 1 and 2 are
true c) Only statements 2 and 3 are true.
b) Only statements 1 and 3 are
true
d) None of the above
statements is true
51 An assembly can exist completely within a single file or can span
across multiple files
[0.5]
Trang 1652 The .NET metadata is a collection of information existing in
_ form inside a Portable Executable file [0.5]
53 In Global Assembly Cache, two assemblies with the same name but
different versions can exist
55 The files that contain only IL code are known as _ [0.5]
56 Splitting the code across various modules enables the .NET cross
58 The _ utility comes along with the .NET framework SDK.
This utility is used to create resource files
[0.5]
59 The Image class belongs to the namespace [0.5]
Trang 1763 Which of the following is/are the part(s) of an assembly? [1.0]
c) MSIL Code
64 Statement 1: Version numbers for an assembly are set in the
Asembly.cs file that accompanies the project
Statement 2: The ILDASM tool can be used to view the assembly
version number being written into the assembly manifest
[1.0]
a) Statement 1 is true c) Statement 2 is true
b) Statement 1 is false d) Statement 2 is false
65 Which of the following can be found in an assembly version number? [1.0]
Trang 18b) Minority d) Build
66 Statement 1: Strong or unique name must be generated for each and
every shared assembly created
Statement 2: In case of a shared assembly, the assembly file is copied
into the applications directory
[1.0]
a) Statement 1 is true c) Statement 2 is true
b) Statement 1 is false d) Statement 2 is false
a) The gacutil.exe can be used
to install and uninstall
assemblies from the GAC
using the command line.
c) The gacutil.exe can be used to list assemblies on the GAC using the command line.
b) Private assemblies can be
shared across different
applications
d) All of the above.
a) The GAC is a cache for
Assemblies.
c) GAC physically is a directory or a folder.
b) Private assemblies need to be
stored in GAC
d) All of the above.
69 Which of the command line options is used to get information
regarding the assemblies residing in the native image cache?
Trang 19class is used to get the resource names?
a) GetManifestResourceNames(
)
c) GetResources()
b) GetResourceNames() d) GetManifestNames()
71 Statement 1: The return type for the GetObject() method is Object.
Statement 2: The return type for the GetObject() method is Int32
[1.0]
a) Statement 1 is true c) Statement 2 is true
b) Statement 1 is false d) Statement 2 is false
b) ResourceWriter class allows
resources up to 4 Gigabytes
d) ResourceWriter class allows
adding only pictures files to
an assembly
73 Consider the syntax of resgen utility below:
Resgen sub.txt sub.resX
Which of the following is/are true?
74 Statement 1: Modules written in different languages like C#, VB.NET
and JScript.NET can be clubbed into a single assembly
Statement 2: Modules written in different languages such as C#,
[1.0]
Trang 20VB.NET and JScript.NET cannot be clubbed into a single assembly.
a) Statement 1 is true c) Statement 2 is true
b) Statement 1 is false d) Statement 2 is false
75 Which of the following is/are true regarding the assembly version
a) Change in the major number
indicates that the assembly
is incompatible with the
previous versions of that
assembly.
d) Change in the build number indicates that a very minor change has been made to the assembly.
b) Change in the minor number
indicates that the assembly is
compatible with the previous
versions of that assembly
e) All of the above
c) Change in the revision
number indicates that the
assembly maybe compatible
with previous versions of
that assembly.
a) Resources can exist either
as part of the NET assembly
or as a separate file.
d) The .NET modules contain
the Type Metadata only
b) The .NET modules contain
the Type Metadata and the IL
Trang 21a) Lists the assemblies from the
GAC c) Uninstalls the specifiedassembly on the GAC
b) Installs the specified assembly
on the GAC
d) Uninstalls the assembly from the native image cache
a) Modules can contain
manifests but no assembly
metadata inside the
manifest.
d) A web browser can get the repeatedly requested data from the cache rather than the original server.
frequently used information.
79 Consider the snippet given below:
ResourceWriter rw = new ResourceWriter("sub.resources");
using(Image img = Image.FromFile("face.jpg"))
a) An instance of Image class is
created in a using statement
d) FileNotFound exception is
thrown if the image fileface.jpg is not present in theapplications directory
b) The object img of the Image
class will be disposed once the
execution reaches the end of
the using construct
e) All of the above.
Trang 22c) If the file sub.resources does
not exist, an exception is
generated
80 Consider the code below that uses the namespace Ex2 with the
resource file sub
Assembly ass = Assembly.GetExecutingAssembly();
ResourceManager resman=new ResourceManager("Ex2.sub",
d) Error is generated due to the
wrong syntax of instantiating
a ResourceManager object
b) System.Resources
namespace has to be
imported.
e) All of the above.
c) Text property of the Label
label1 is set with the value
referred by the key
corresponding resource file.
a) There is a need to make an
assembly a shared assembly
to use it in more than one
application
d) The sn.exe makes use of
various cryptographic orencryption algorithms
b) Shared assembly must not
have naming clashes with
other assemblies
e) All of the above.
c) The sn.exe is the utility to
make a unique identifier
Trang 23across the entire system for
c) Uninstalls the specified
assembly on the GAC
b) Installs the specified
assembly on the GAC d) Uninstalls the assembly fromthe native image cache
a) The Global Assembly Cache is
a part of Native Image Cache
d) Ngen.exe utility is used to install an assembly onto the Native Image Cache.
b) The Native Image Cache
stores assemblies in their
native machine independent
native code
e) All of the above.
c) GAC stores assemblies in IL
b) Installs the specified assembly
on the GAC d) Uninstalls the assembly fromthe native image cache
85 Which of the following is/are the part(s) of manifest of an assembly? [2.0]
a) A list of referenced
assemblies
d) Exported types included from
a module
Trang 24b) A set of permission requests e) All of the above.
c) A list of files belonging to this
assembly
86 Statement 1: The reflection mechanism can use the information about
the exported types for late binding to classes
Statement 2: Type-library can be easily generated out of manifest for
the use of COM clients
[2.0]
a) Statement 1 is true c) Statement 2 is true
b) Statement 1 is false d) Statement 2 is false
87 Which of the following is/are true regarding modules? [2.0]
a) They are only loaded when
needed.
d) They can be used for slower
startup of assemblies
b) They are DLLs without
assembly attributes e) All of the above.
c) Usually they do not have
assembly metadata and
have no version information
present within it.
88 Which of the following namespaces has/have classes that can be used
for the assembly attributes arguments?
[2.0]
a) System.Reflection c) System.Reflection.InteropServices
b) System.Runtime.Compiler
89 Statement 1: An assembly can use a resource, not embedded within a
DLL file, by referencing through assembly metadata
Statement 2: An assembly metadata can be used to reference
a netmodule file
[2.0]
a) Statement 1 is true c) Statement 2 is true
Trang 25b) Statement 1 is false d) Statement 2 is false
a) The attribute, [assembly] is
a global attribute c) The attribute, [module] is a global attribute.
b) The attribute, [import] is a
global attribute
d) Global attributes are not attached to a specific language element.
a) Manifest must contain list of
files belonging to an
assembly
c) A single assembly can
contain any number of files
b) A single assembly must have
at least one file
d) All of the above.
92 Statement 1: Manifest is a part of metadata that describes the
assembly with all information needed to reference it
Statement 2: Manifest consists of identity name, culture and version
but no public key
[2.0]
a) Statement 1 is true c) Statement 2 is true
b) Statement 1 is false d) Statement 2 is false
93 Which of the following is/are true regarding integrity using strong
a) When creating a shared
component, a public /private
key pair must be used.
d) The strong name utility generates a public/private key pair.
b) The private key is stored
within the assembly e) All of the above.
Trang 26c) The compiler usually writes
public key to the manifest.
94 Which of the following is/are returned by the FullName property of
a) The name of the class d) The public key token of the
class
b) The version of the class e) All of the above.
c) The locality of the class.
95 Consider the snippet given below:
[assembly: AssemblyVersion(“1.0.*”)]
Which of the following is/are true?
[2.5]
a) The above code generates
b) The major version is 1 d) The build and revision
numbers are auto generated.
a) After compiling the assembly
to native code, the original
assembly with the MSIL code
can be deleted
d) An assembly stored on the Native Image Cache executes faster.
b) The native code will be
rebuilt if the security
changes on the system.
e) All of the above
c) By using the native image
generator Ngen.exe, IL code
is compiled to native code
at the time of installation.
Trang 2797 Which of the following is/are true regarding assemblies? [2.5]
a) Private assemblies will be
used when applications and
components are built within
the same company.
d) Private assemblies will be
used to build assemblieswhen the component is built
by a different vendor thanthe application
b) Shared assemblies will be
used when the component
is built by a different vendor
than the application.
e) All of the above.
c) Shared assemblies will be
used when a large
application is split into
99 Which of the following is/are true regarding GAC? [2.5]
a) Shared assemblies can be
installed in GAC d) When .NET componentswithin HTML pages are
downloaded to the client, itstores assemblies in GAC
b) Private assemblies can be
installed in GAC e) All of the above.
c) The compiled native code
goes into GAC if a private
assembly is compiled to native
code using the native image
Trang 28100 Which of the following are true regarding assemblies? [2.5]
a) A private assembly can exist
in the same directory as the
application.
d) A single namespace can spread across various assemblies.
b) A private assembly cannot
exist within one of the
subdirectories of the
application
e) All of the above.
c) Different namespaces can
exist in a single assembly.
101 .NET can be thought of as a component technology similar to COM [0.5]
102 The is an acronym for Type Library Export [0.5]
103 Visual Studio .NET while generating a wrapper for the COM
component creates a namespace with a different name than the COM
Trang 29105 Runtime Callable Wrapper is a NET assembly [0.5]
107 Regarding the lifetime of the RCW, exactly one copy of the RCW
object is created irrespective of the number of clients requesting the
same COM component
[0.5]
108 A non-.NET client can call NET components by referring to them once
109 The _ utility is used to convert a COM Type Library into a NET
110 _ is the wrapper object created when a NET component is
111 CCW object(s) is/are created for a managed .NET
component irrespective of the number of COM clients trying to access
Trang 30to the same NET Component.
113 Statement 1: COM components manage the lifetime of their object by
reference counting whereas in NET, the CLR manages the lifetime of
the object
Statement 2: Marshalling of data is taken care of by RCW
[1.0]
a) Statement 1 is true c) Statement 2 is true
b) Statement 1 is false d) Statement 2 is false
114 Which of the following is/are the way(s) in which COM and NET
components differ?
[1.0]
a) COM components use
interfaces whereas .NET
clients use reflection to
learn about the functionality
of the object.
c) The .NET components
manage their lifetimewhereas the CLR managesthe lifetime for COMcomponents
b) COM components use
reflection whereas .NET
clients use interfaces to learn
about the functionality of the
object
d) COM components manage their lifetime whereas the CLR manages the lifetime
in NET.
115 Statement 1: The .NET client talks to a COM component directly
without any RCW interface
Statement 2: Type casting of data types is taken care of by RCW
[1.0]
a) Statement 1 is true c) Statement 2 is true.
b) Statement 1 is false d) Statement 2 is false.
116 Which of the following is/are true regarding calling a COM component
from NET?
[1.0]
a) Visual Studio.net creates a namespace with the same name
as the COM component within which all the classes and
Trang 31interfaces exist.
b) Objects of the COM wrapper can be created using the
namespace created by Visual Studio.net.
c) Objects of the COM wrapper cannot be instantiated using the
namespace created by Visual Studio.net
d) Objects of the COM wrapper cannot be referenced using the
namespace created by Visual Studio.net
117 Statement 1: Interoperability between NET and COM is achieved by
creating a proxy class for every COM component that the NET client
tries to access
Statement 2: The proxy talks directly to the COM component, and not
to the NET client
[1.0]
a) Statement 1 is true c) Statement 2 is true
b) Statement 1 is false d) Statement 2 is false
a) COM provides language independent code re-use.
b) A COM component exposes its functionality through a set of
standard interfaces that a COM client uses to communicate
c) A COM component with its GUID needs to be registered in the
Windows registry
d) All of the above.
119 Which of the following is/are true regarding the deployment of NET
application that refers to a COM component?
[1.0]
a) The deployment of only RCW and the client is not sufficient.
b) The deployment of only RCW and the client is sufficient.
c) The COM component must also be registered on the
Trang 32d) The COM component need not be registered on the machine.
120 Statement 1: The RCW maintains pointers to the interface of the COM
object it wraps
Statement 2: The RCW releases its reference on the COM object
when it is no longer used
[1.0]
a) Statement 1 is true c) Statement 2 is true.
b) Statement 1 is false d) Statement 2 is false.
121 Which of the following is/are true regarding CCW and RCW? [1.0]
a) The CCW is COM Clearable
to the COM environment.
122 Which of the following is the syntax for using the RegAsm utility on the
123 Statement 1: In order to call a NET component from a COM client,
one needs to register the assembly using the RegAsm utility first and
then export a type library from the components manifest using the
TlbExp utility
Statement 2: In order to call a NET component from a COM client
one needs to register only the assembly using the RegAsm utility
[1.0]
a) Statement 1 is true c) Statement 2 is true.
Trang 33b) Statement 1 is false d) Statement 2 is false.
124 Which of the following utility ventures into the assembly’s metadata
and manifest and outputs a corresponding COM type library with an
extension TLB?
[1.0]
125 Which of the following is true regarding CCW? [1.5]
a) It is created when a .NET
component is called from
COM
d) It acts as a proxy between
the COM component and the.NET client
b) It is generated by runtime that
reads the metadata
information within the
assembly
e) All of the above.
c) It bridges the gap between the
two environments COM
b) RegAsm.exe is used to
register a NET class in the
windows registry so that
COM clients can access it.
e) All of the above.
c) RegAsm.exe is not used to
unregister a NET component
Trang 34127 Which of the following is/are true? [1.5]
a) The RCW manages the
pointer locations by making a
cache of pointers
d) RCW acts as a mediator
to NET client and the COMcomponent
b) The RCW object is allocated
on the heap by the CLR
e) All of the above.
c) The CLR performs the
automatic garbage collection
of the RCW once it has been
de-referenced
128 Statement 1: COM components return a memory pointer to an object.
Statement 2: COM components must reside in the same memory
location throughout the lifetime of the object
Statement 3: .NET objects can shift between virtual and physical
memory freely as and when either becomes more available
[1.5]
a) Only statement 1 is true d) Only statement 1 and 3 are
true
b) Only statement 2 is true e) Statements 1, 2, 3 are true.
c) Only statement 1 and 2 are
true
129 Which of the following is/are the way(s) in which COM components
differ from the NET components?
[1.5]
a) Lifetime of the object c) Memory Usage.
b) Interfaces vs Reflection d) All of the above.
130 Statement 1: The process of reflection exposes the type information
stored in the form of Metadata in RCW
Statement 2: The process of reflection helps Visual Studio.net in
reading the type information of RCW to provide the IntelliSense
[1.5]
a) Statement 1 is true c) Statement 2 is true
Trang 35b) Statement 1 is false d) Statement 2 is false
131 Consider a method of a COM component to be called by the NET
client that takes in a string parameter Which of the following is/are the
type(s) that RCW marshals before passing the call to the COM
created by Visual Studio.net
in the applications directory.
d) The RCW type information
is marshaled from COM types into NET types and then written into the assembly.
b) The RCW contains business
logic
e) Marshalling is the process
of converting data from one type to another.
c) RCW does not contain the
type information of the
elements contained within the
COM component
a) The NET code executes in an
execution environment
managed by the NET CLR
d) NET exposes the classes
and methods in an assemblyusing metadata andreflection
b) COM code executes in an
unmanaged environment
e) All of the above.
c) COM exposes its classes and
Trang 36methods through interfaces.
134 Which of the following is/are true regarding COM components? [1.5]
a) It is uniquely identified by a
128-bit GUID d) provides cross-languageinheritance
b) It has to be registered in the
Windows registry with the
GUID.
e) All of the above.
c) It provides cross-language
code re-use capability.
135 Statement 1: Microsoft provides tools in the NET SDK for generating
COM proxies for NET components
Statement 2: Microsoft provides tools in the .NET SDK for
generating NET proxies for COM components
[2.0]
a) Statement 1 is true c) Statement 2 is true
b) Statement 1 is false d) Statement 2 is false
136 Statement 1: COM components can be difficult to code.
Statement 2: COM components are very easy to deploy
[2.0]
a) Statement 1 is true c) Statement 2 is true
b) Statement 1 is false d) Statement 2 is false
137 Which of the following are the binding techniques used by the NET
clients to determine the memory addresses of the methods and
properties of COM objects
[2.0]
Trang 37138 Statement 1: Once a COM dll is located through the references dialog
box and added to the list of COM references, the COM component
can be used in the NET code
Statement 2: VS.NET creates a namespace bearing the same name
as the original COM component but the classes provided by that COM
component are not placed within that namespace
[2.0]
a) Statement 1 is true c) Statement 2 is true
b) Statement 1 is false d) Statement 2 is false
139 Which of the following is/are true regarding the options of type library
importer provided by NET SDK?
a) The option /verbose displays
command syntax and options
for the tool
suppresses the display of successful messages.
[2.0]
b) The option /? displays
additional information about
the imported type library
140 Statement 1: VS.NET creates a wrapper not only for every COM DLL
that is imported but also for every COM DLL that the imported COM
DLL references in its public interface
Statement 2: VS.NET creates a wrapper only for COM DLL that is
imported but not for every COM DLL that the imported COM DLL
references in its public interface
[2.0]
a) Statement 1 is true c) Statement 2 is true
b) Statement 1 is false d) Statement 2 is false
141 Statement 1: The NET assemblies require less runtime support than
COM components
Statement 2: The NET assemblies require more runtime support than
COM components
[2.0]
a) Statement 1 is true c) Statement 2 is true
b) Statement 1 is false d) Statement 2 is false.
Trang 38142 Statement 1: A single NET client can simultaneously reference
component projects in several different NET languages
Statement 2: A single .NET client can simultaneously reference
component projects only in same NET language
[2.0]
a) Statement 1 is true c) Statement 2 is true
b) Statement 1 is false d) Statement 2 is false.
a) The utility RegAsm can
register a .NET component
with COM services
c) The utility TlbExp can be
used to export a COM type library for the client and reference it from the non-.NET languages
b) The utility TlbExp can be used
to interrogate an assembly’s
manifest
d) All of the above are true.
144 Which of the following is/are true when a reference is added to the
COM DLL using references dialog in VS.NET?
[2.5]
a) A .NET proxy component is
generated for it and its copy is
placed in the .NET projects
directory
c) The NET client only talks to
the proxy and receives datathe proxy relays back fromthe COM DLL
b) The .NET proxy component
generated describes the COM
DLL and serves as a delegate
for it to forward the calls from
the NET client through COM
services to the COM DLL that
it wraps
d) All of the above.
145 Which of the following is/are true regarding COM? [2.5]
a) COM components do not
provide cross-language d) COM compliant languages have facilities for getting
Trang 39communication the value of a COM
component’s GUID.
b) COM components can
provide the count of number
of clients that are
referencing it.
e) All of the above.
c) COM class can make use of
prewritten functionality for
security object pooling and
resource conservation.
a) The .NET component file
encapsulates its own
b) Different versions of the
same .NET component can
exist side by side on the same
machine and it can be in the
same folder
d) All of the above.
147 Statement 1: When the TlbImp program is executed against a COM
DLL, it interrogates the COM DLL’s type library and translates the
information therein into a NET format, converting COM standard data
types into those recognized by NET
Statement 2: When the utility TlbImp.exe is run against a COM DLL,
its output file (the RCW) is placed into the folder of the client
executable that will use it
[2.5]
a) Statement 1 is true c) Statement 2 is true
b) Statement 1 is false d) Statement 2 is false
148 Which of the following is/are the drawback(s) of static linking of library
files?
Statement 1: Wastage of storage space by placing redundant copies
[2.5]
Trang 40of identical functions in multiple executables.
Statement 2: A bug existing in one of the utility functions causes a
need to recompile and redistribute every executable that called that
function
a) Statement 1 is true c) Statement 2 is true
b) Statement 1 is false d) Statement 2 is false
a) Late binding is slow as
compared to early binding
d) Late binding in C# can be
achieved through reflection
b) Writing a late bound code can
be difficult and time
consuming
e) All of the above.
c) In C# programming, when late
binding to a COM component,
there is no need to create an
RCW
150 Which of the following is/are the advantage(s) of DLL? [2.5]
a) Function libraries were
compiled into standalone
binary files to be linked
dynamically to form separate
executable files
d) Dlls are language specific.
b) Several executable programs
could share the same library
(.DLL) file
e) All of the above.
c) Fixing a utility function does
not need recompiling or
redistributing all the
executables that referenced it
151 The web server, Internet Information Server comes along with [0.5]