Which part of the .NET Framework verifies that code is type-safe?
Answer : C
You need to suspend the current thread until all Finalize() methods have been processed.
Which garbage collection method should you use?
Answer : D
You define a method according to the following code segment. (Line numbers are included for reference only.)
Answer : C
Custom event delegates are used to:
Answer : C
Which two tasks does the interoperability of the .NET language allow you to perform?
(Choose two.)
Answer : A,D
Which three characteristics define the identity of an assembly? (Each correct answer presents part of the solution. Choose three.)
Answer : A,D,E
Explanation: * The Assembly Class represents an assembly, which is a reusable, versionable (D), and self-describing building block of a common language runtime application.
* Assembly Properties include_
/ FullName (A)
Gets the display name of the assembly.
* (D) The AssemblyName.CultureInfo property gets or sets the culture supported by the assembly.
The SecureString class:
Answer : B
A type-safe language prevents:
Answer : B
Explanation: Type-safe code accesses only the memory locations it is authorized to access.
Which format is the correct version for a .NET application?
Answer : C
You want to encrypt the connection string stored in the web.config file.
Which tool should you use?
Answer : A
Explanation: You can use the ASP.NET IIS Registration Tool (Aspnet_regiis.exe) to encrypt or decrypt sections of a Web configuration file.
Example:
The following command encrypts the connectionStrings element in the Web.config file for the application SampleApplication. aspnet_regiis -pe "connectionStrings" -app "/SampleApplication" -prov
"RsaProtectedConfigurationProvider"
Type-safe code accesses only the memory locations:
Answer : A
Which file contains the required .NET settings for an ASP.NET web application?
Answer : B
You create an unmanaged object and use the object. You no longer need the object.
What should you do?
Answer : C
Explanation: The term "unmanaged resource" is usually used to describe something not directly under the control of the garbage collector. For example, if you open a connection to a database server this will use resources on the server (for maintaining the connection) and possibly other non-.net resources on the client machine, if the provider isn't written entirely in managed code.
This is why, for something like a database connection, it's recommended you write your code thusly: using (var connection = new SqlConnection("connection_string_here"))
{
// Code to use connection here
}
As this ensures that .Dispose() is called on the connection object, ensuring that any unmanaged resources are cleaned up.
What is the characteristic of a delegate?
Answer : A
Explanation: The .NET Framework defines a special type (Delegate) that provides the functionality of a function pointer.
A delegate is a class that can hold a reference to a method. Unlike other classes, a delegate class has a signature, and it can hold references only to methods that match its signature. A delegate is thus equivalent to a type-safe function pointer or a callback.