How to add Silverlight assembly to GAC

    Recently, I was puzzled by the issue of adding a Silverlight assembly to the GAC. This is necessary in order to be able to refer to an assembly of several projects and not to transfer this assembly every time with a project.

    As you know, the Silverlight runtime is not the same as the .NET Framework runtime and just adding the assembly to the global repository using gacutil has no effect. But on the other hand, after installing Silverlight, we can see in the list of available assemblies of the “Add reference” dialog in Visual Studio the set of standard assemblies that are part of Sliverlight.

    As it turned out, in order to make it possible to refer to the assembly from any projects through the “Add reference” dialog, you need to add a special key to the registry:

    1. Open the key HKEY_LOCAL_MACHINE \ SOFTWARE \ Wow6432Node \ Microsoft \ Microsoft SDKs \ Silverlight \ v4.0 \ AssemblyFoldersEx
    if you have a 32-bit OS, then the “Wow6432Node” component must be excluded
    2. At this location, create a key with some name ( e.g. project name).
    3.Add the default value containing the path to the assemblies on the hard drive.

    Now, when adding a link to the project, in the “Add reference” dialog, all assemblies from the specified folder will be available.

    The solution to the problem is not very complicated, but at the right time, it happens, it is very difficult to find it. I wish you success!

    Also popular now: