Programming in C# — Question 99
You are developing an assembly that will be used by multiple applications.
You need to install the assembly in the Global Assembly Cache (GAC).
Which two actions can you perform to achieve this goal? (Each correct answer presents a complete solution. Choose two.)
Answer options
- A. Use the Assembly Registration tool (regasm.exe) to register the assembly and to copy the assembly to the GAC.
- B. Use the Strong Name tool (sn.exe) to copy the assembly into the GAC.
- C. Use Microsoft Register Server (regsvr32.exe) to add the assembly to the GAC.
- D. Use the Global Assembly Cache tool (gacutil.exe) to add the assembly to the GAC.
- E. Use Windows Installer 2.0 to add the assembly to the GAC.
Correct answer: D, E
Explanation
The correct answers are D and E because both methods specifically allow the assembly to be added to the Global Assembly Cache. Option A is incorrect because regasm.exe does not copy assemblies to the GAC; it is used for COM interop. Option B is incorrect as sn.exe is used for creating strong-named assemblies, not for adding to the GAC. Option C is also wrong since regsvr32.exe is intended for registering COM components, not for GAC operations.