Wen
Thanks very much for the response. I've spent a lot of time studying
assembly binding over the past couple of days, and I have a much greater
understanding now - but still have some learning to do.
> I guess your project may reference to some other assembles which
> indirectly
> reference to ICSharpCode.SharpZipLib dll. Thus, there is no any entry
> (which reference to SharpZipLib.dll directly) in your .csproj file.
> Because
> SharpZipLib dll doesn't exist in GAC, the project failed to compile. After
Ah, but the project didn't fail to compile because the assembly could not be
found, it failed because two versions of the same assembly were being copied
to the bin directory of the project. This is where my confusion lies - if
one (we don't know which one) of the referenced assemblies is referencing
version 0.6.0.0 of the ICSharpCode.SharpZip assembly and trying to copy it
to the bin directory, why is the build not failing on the grounds that this
version (0.6.0.0) cannot be found? And why does copying the
ICSharpCode.SharpZipLib assembly version 0.5.0.0 the GAC prevent whichever
assembly was referencing version 0.6.0.0 kicking up a fuss? I thought that
this was one of the points of strong naming, so that if a particular version
of an assembly is referenced then this is the version that will be bound.
> you registered it in GAC, the issue goes away. As far as I know, there is
> no tool to list all assembles which referenced (directly/indirectly) in
> project easily. One way is to use .Net Reflector to check each reference
> in
> your project.
> http://www.aisto.com/roeder/dotnet/
Yes, I started using this yesterday - thanks for the tip.
In addition to actually solving this specific problem, I'm also trying to
use it as a base for gaining a much more in-depth understanding of assembly
binding by the runtime. Someone posted some really useful articles, but it
occurred to me that what would be great would be a flow chart detailing all
steps taken by the runtime in order to resolve assembly bindings. Does
anyone know if one of these exists? If not I'll have a crack at knocking one
up in Visio - possibly people in this group may like to critique it
afterwards. I'd rather someone else had already done it for me, though :)
Thanks again.
Cheers!

Signature
Regards
Chris Marsh
WenYuan Wang [MSFT] - 18 Dec 2007 12:11 GMT
Hello Chris,
Thanks for your reply.
There must be something make VS IDE put SharpZip assembly into bin folder
when building. But, I am afraid it's not easy for us to find out the exact
root cause without further information captured when the problem occurs.
I haven't a flow chart for assembly runtime binding. Hope the following
document helps.
http://msdn2.microsoft.com/zh-tw/library/yx7xezcf(VS.90).aspx
[How the Runtime Locates Assemblies]
Have a great day,
Best regards,
Wen Yuan
Microsoft Online Community Support
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.