Assembly needs to be redeployed into GAC every time its user app is changed

So basically we have an strong-names (strongly signed) assembly x.dll which is used by one of our components, App.exe. The signing key of the assembly is in our repository and it the assembly is signed by means of writing

[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFileAttribute(@"..\..\xxx.snk")]
[assembly: AssemblyKeyName("")]

The assembly is supposed to be put in GAC by some installer which installs common packages, let's name it common.msi. But our component itself is installed by App.msi. When deployed together, everything works. But when changes are made to App.msi, ones that have ABSOLUTELY nothing to do with x.dll, and App.msi is redeployed, App.exe fails to find x.dll. Note that no changs are made to x.dll. When, however, common.msi is deployed as well, everything works. So I am guessing there must be an issue with build versions or something, or manifests which I know nothing about. Is there something obvious that I am doing wrong? Isn't it possible to just deploy the assembly separately and not touch it unless it is changed and not redeploy it every time a component that uses it is changed? Thanks.

Edit: It is a requirement (one I can't do anything about) that the ssembly be put in GAC

Answers


Why are you installing it into the GAC? Don't do that.

The title of your question "Assembly needs to be redeployed into GAC" is just wrong. Nothing you've written implies that the assembly needs to be in the GAC.


EDIT - some additional information.

If you want to examine dependencies, you can use Redgate's Reflector to examine an assembly, like your App.exe, to determine which other assemblies it depends on and requires. These dependencies will include version numbers.

I don't know of a tool from the commandline that will just emit assembly information. Maybe there is one. Lacking this, I wrote a tool to do it, like this:

    public static void Main(string[] args)
    {
        if ((((args == null) || (args.Length != 1)) || (args[0] == "-?")) || (args[0] == "-h"))
        {
            Usage();
        }
        else
        {
            try
            {
                Console.WriteLine(Assembly.LoadFrom(args[0]).FullName.ToString());
            }
            catch (Exception exception)
            {
                Console.WriteLine("Exception: {0}", exception.ToString());
                Usage();
            }
        }
    }

You could run this tool on App.exe as well as x.dll to determine the exact strong name, including version numbers, embedded into each assembly.

This might help give you some insight into why things aren't working as you expect.

Even if one version of x.dll is in the GAC, there's no need for an arbitrary app, like App.exe, to use that version of the DLL. The app can install in the local directory its own version of the dll.


Need Your Help

keyboard events in .NET

c# vb.net forms keyboard

The key up event gets triggered when a key is released. This holds true for normal keys like a, b etc. However, holding down the arrow key or escape key produses different results.

How to overlay text with a line to create flip-clock style

android layout shape

I need to create a flip clock styled counter, that should look like this:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.