GAC confusion

  • Thread starter Thread starter Gisle Vanem
  • Start date Start date
G

Gisle Vanem

I'm trying to understand the search algorithm done when the CLR (?) is
looking for DLLs. At first I've put the DLL(s) in the cache by "gacutil -i foo.dll"
and the program using foo.dll works fine.

But then I became aware of "program.exe.config" could also define a path to
foo.dll {*]. So in real-life, which .dll is the CLR trying to use? Is there some
tools like depends or cygcheck, but for .net programs somewhere?

{*] something like:

<configuration xmlns:asm="urn:schemas-microsoft-com:asm.v1">
<runtime>
<asm:assemblyBinding>
<asm:dependentAssembly>
<asm:assemblyIdentity name="foo"
publicKeyToken="013643f01f384224" />
<asm:codeBase version="1.2.0.0"
href="file://g:/mingw32/src/inet/foo.dll" />
</asm:dependentAssembly>

--gv
 
Gisle,

I have posted a URL below that accurately explains how the runtime binds and
locates Assemblies.

You can also view this for your self by using the Assembly Binding Log
Viewer (fuslogvw.exe). Just follow these steps to see the paths that were
searched:

- Launch fuslogvw.exe from the VS.net command prompt
- Select the log failures check box
- Delete/Move a .dll file from the project that you would like to examine
- Run the project that you just deleted the file
- Switch to the Assembly Binding Log Viewer and click on the refresh button
- Select the entry for the project that you just ran and you will see the
information about where the CLR looked for the assemblies

Good Luck!
 
Brian Brown said:
I have posted a URL below that accurately explains how the runtime binds and
locates Assemblies.

Thanks for the info. I don't pretend to understand all of the cache issues yet.

But I have another problem; I had the 2.0 beta framework, but uninstalled it due
to various reasons. Once I reverted to 1.0.3705, I'm getting this error:
gacutil -i LibCurlNet.dll

Microsoft (R) .NET Global Assembly Cache Utility. Version 1.0.3705.0
Copyright (C) Microsoft Corporation 1998-2001. All rights reserved.

Failure adding assembly to the cache: Attempt to install an assembly without a strong name

----

Anybody know what's wrong and a way around this? The assemplyinfo.cs doesn't
have any 'strong name' or keyfile.

--gv
 
Gisle ,

If you are adding a shared assembly to the GAC it has to have a strong name.
You can use sn.exe to create the strong name for the assembly and use the
assembly linker (al.exe) to link the strong name to the assembly. I have
included a couple of links below that will explain it in detail.

Good Luck!

-----------------
http://msdn.microsoft.com/library/d.../cptools/html/cpgrfstrongnameutilitysnexe.asp

http://msdn.microsoft.com/library/d...ml/cpconStrong-NamedAssemblies.asp?frame=true

http://msdn.microsoft.com/library/d...conassigningassemblystrongname.asp?frame=true
 
Back
Top