gacutil /l does not show mscorlib

M

Martin

I cannot get my application working, it cannot load a local dll. This local
dll has some dependencies, and I am trying to see if all the dependacies are
right.

Now the app/dll is dependant of mscorlib. I think all .NET apps are
dependant of this right? Then I check what was in the GAC with gacutil /l
and this dll does not show. Is it that standard that it is not listed, or is
there something wrong, or am I thinking something totally stupid?

Here my output, no mscorlib:


Microsoft_VsaVb, Version=7.0.5000.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a, Custom=null
msatinterop, Version=7.0.3300.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a, Custom=null
mscorcfg, Version=1.0.3300.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a, Custom=null
mscorcfg, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a, Custom=null
MSDATASRC, Version=7.0.3300.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a, Custom=null
MSDDSLMP, Version=7.0.3300.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a, Custom=null
MSDDSP, Version=7.0.3300.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a, Custom=null


One other newbee question in this. If your app refers to some dll in the
GAC, does that mean that all dll must be registered in the GAC or can I have
some local, some in the GAC??
 
M

Martin

I can see with the file explorer in C:\WINDOWS\assembly that the file
mscorlib is present, by the way. Why does not it shoe with gacutil /l ??
 
A

Anders Norås [MCAD]

Now the app/dll is dependant of mscorlib. I think all .NET apps are
dependant of this right? Then I check what was in the GAC with gacutil /l
and this dll does not show. Is it that standard that it is not listed, or
is there something wrong, or am I thinking something totally stupid?
Yes, all .NET apps depend on mscorlib. In versions 1.x of the .NET framework
this assembly is not in the GAC, but in the framework directory. In .NET 2.0
mscorlib is registered in the GAC.
You can use
System.Runtime.IneropServices.RuntimeEnvironment.GetRuntimeDirectory to
locate the framework directory.
One other newbee question in this. If your app refers to some dll in the
GAC, does that mean that all dll must be registered in the GAC or can I
have some local, some in the GAC??
Yes, usually you'll use some global and some private assemblies. The runtime
uses the following steps to resolve an assembly reference:
1. Determine the correct assembly version by examining applicable
configuration files, including the application configuration file, publisher
policy file, and machine configuration file.
2. Check whether the assembly name has been bound to before. If so, the
previously loaded assembly is used.
3. Check the global assembly cache. If the assembly is found there, that
assembly is used.
4. Probes for the assembly using the following steps:
a) If configuration and publisher policy do not affect the original
reference and if the bind request was created using the Assembly.LoadFrom
method, the runtime checks for location hints.
b) If a codebase is found in the configuration files, the runtime checks
only this location. If this probe fails, the runtime determines that the
binding request failed and no other probing occurs.
c) Probes for the assembly using the heuristics described in the probing
section. If the assembly is not found after probing, the runtime requests
the Windows Installer to provide the assembly. This acts as an
install-on-demand feature.

For more information read "How the Runtime Locates Assemblies":
http://msdn.microsoft.com/library/d...ide/html/cpconhowruntimelocatesassemblies.asp

Anders Norås
http://dotnetjunkies.com/weblog/anoras/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top