We are having a lot of trouble with problems relating to failures relating
to 'The located assembly's manifest definition with name 'xxx' does not
match the assembly reference" but none of us here really understand how this
could be an issue. The assemblies that the system is complaining about are
ones that we build here and we're not changing version numbers on anything.
The errors come and go with no apparent rhyme or reason.
We do not see where the problem is coming from. We've done the obvious
things (look at the reference properties, make sure that the version number
shown is the same as the one in the DLL's file properties) and don't see
where the problem is coming from. The version numbers look right. We've
looked high and low for stale copies of the assemblies and, while multiple
copies of the various assemblies exist, they all appear to be the same
revision.
Background:
We're building a number of C# classes which are being hosted in C# exe test
programs, ASP.NET pages, conventional ASP pages and VB programs.
Building C# class assemblies in Dev Studio 2003.
The codebase is contained within two Dev Studio solutions.
- One is a small set of c# classes that haven't changed in months.
- The other is the on going development effort.
When a new project is added, it's AssemblyInfo.cs file gets two and only two
changes:
- AssemblyDelaySign(true) and
- the AssemblyKeyFile points to a key file that is shared across the entire
project.
The project post build event has two lines in it
- Sn -Vr "$(TargetPath)"
- and a DOS copy command to put the signed assembly in a common staging
area.
There are interop classes that permit unmanaged code to access the classes.
The managed code makes use of the classes directly.
The project TestAccount is set as the startup project.
When TestAccount builds, copies of the various assemblies are copied to its
product output directory.
The assemblies are not being added to the GAC.
Typical failure:
- Object a, which is in assembly B, is successfully created through the use
of new B.
- An exception is thrown when a function in a is called.
- The exception says that the located assembly's manifest definition does
not match the assembly reference.
Questions:
Q1) Under what conditions can a mismatched version error manifest?
Q2) How can we find and fix the reason(s) for the multiple, sporadic
manifest mismatch problems?
Q3) When TestAccount.exe runs, what is the process that executes that lets
it know what assembly versions to look for?
Q4) Where are these values stored?
Q5) What is the search path for the target assemblies?
Q6) Why does the object creation succeed but the call to the object's
function throw an exception?
--
Richard Lewis Haggard
www.Haggard-And-Associates.com