Lukasz Hr Lukasz Hr - 1 year ago 83
C# Question

Assembly installation in the GAC

I'm preparing for 70-483 MS exam, and I have sample question: "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.)

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."

Suggested answers are B and D, is this correct? I think that correct might be D and E. Can anybody help me?

Answer Source

Not sure what you need help with, but the reason it was not D and E is regsvr32.exe does not register stuff in the GAC that is for registering COM objects and the feature to install to the GAC was introduced in a version later than Windows Installer 2.0.

The reason it is B and D is all assemblies that are registered in the GAC must be strong named, you use the sn.exe tool to do that. Once you have a strong named tool you use gacutil.exe to add it to the registry.