Assembly needs to be redeployed into GAC every time its user app is changed
[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
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.
精彩评论