You need to test your application immediately

You are developing a Windows-based application that requires the use of a calculation function named CalculateValue. This function includes the following signature:

int CalculateValue(int);

CalculateValue is located in an unmanaged DLL named UsefulFunctions.dll, and is not part of a COM interface. You need to be able to use CalculateValue in your application. Your project directory contains a copy of UsefulFunctions.dll.

While you are working in Debug mode, you attempt to run your application. However, a System.DllNotFoundException is thrown.

You verify that you are using the correct function name. You also verify that the code in the DLL exposes CalculateValue. You have not modified the project assembly, and you have not modified machine-level security. You need to test your application immediately.
What should you do?

You are developing a Windows-based application that requires the use of a calculation function named CalculateValue. This function includes the following signature:

int CalculateValue(int);

CalculateValue is located in an unmanaged DLL named UsefulFunctions.dll, and is not part of a COM interface. You need to be able to use CalculateValue in your application. Your project directory contains a copy of UsefulFunctions.dll.

While you are working in Debug mode, you attempt to run your application. However, a System.DllNotFoundException is thrown.

You verify that you are using the correct function name. You also verify that the code in the DLL exposes CalculateValue. You have not modified the project assembly, and you have not modified machine-level security. You need to test your application immediately.
What should you do?

A.
Move UsefulFunctions.dll to your project’s bin directory.

B.
Move UsefulFunctions.dll to your project’s Debug directory.

C.
Immediately before the declaration of CalculateValue, add the following code segment:
[SuppressUnmanagedCodeSecurityAttribute()]

D.
Immediately before the call to CalculateValue, add the following code segment:
SecurityPermission perm = new SecurityPermission(
SecurityPermissionFlag.UnmanagedCode);
perm.Assert();



Leave a Reply 0

Your email address will not be published. Required fields are marked *