Relationship between an assembly's name vs its filename

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

What is the relationship between an assembly's file name and its logical (friendly) name? I know that they are the same when building an assy (for example, building the assy --> MyAssy produces the file --> MyAssy.dll).

But does the assembly's file name *have* to be the same as its name? For example, if the filename is changed, can the loader still find the assy (since assemblies are self-identifying)?

Possible scenario:

1. Place private assy (MyAssy.dll) in its app base dir.
2. Change the filename of the assy to MyAssyXYZ.dll.
3. The loader probes for the assembly MyAssy.
4. The loader finds the assembly, even though the file name has changed-- because the loader examined metadata for the assembly of interest, not filenames.

My guess is that this would not work, and, to be honest, I am too lazy to conduct my own experiments. Does anybody have a ready answer?

Thanks--
 
An assembly's name = file name - dll or - exe

--

Sven


madgett said:
Hello,

What is the relationship between an assembly's file name and its logical
(friendly) name? I know that they are the same when building an assy (for
example, building the assy --> MyAssy produces the file --> MyAssy.dll).
But does the assembly's file name *have* to be the same as its name? For
example, if the filename is changed, can the loader still find the assy
(since assemblies are self-identifying)?
Possible scenario:

1. Place private assy (MyAssy.dll) in its app base dir.
2. Change the filename of the assy to MyAssyXYZ.dll.
3. The loader probes for the assembly MyAssy.
4. The loader finds the assembly, even though the file name has changed--
because the loader examined metadata for the assembly of interest, not
filenames.
My guess is that this would not work, and, to be honest, I am too lazy to
conduct my own experiments. Does anybody have a ready answer?
 
The reference in your visual studio project will break if you rename the
assembly.

But you can change any of the properties for the assembly in the property
pages, this includes the file name and the root namespace.

cheers

martin.



madgett said:
Hello,

What is the relationship between an assembly's file name and its logical
(friendly) name? I know that they are the same when building an assy (for
example, building the assy --> MyAssy produces the file --> MyAssy.dll).
But does the assembly's file name *have* to be the same as its name? For
example, if the filename is changed, can the loader still find the assy
(since assemblies are self-identifying)?
Possible scenario:

1. Place private assy (MyAssy.dll) in its app base dir.
2. Change the filename of the assy to MyAssyXYZ.dll.
3. The loader probes for the assembly MyAssy.
4. The loader finds the assembly, even though the file name has changed--
because the loader examined metadata for the assembly of interest, not
filenames.
My guess is that this would not work, and, to be honest, I am too lazy to
conduct my own experiments. Does anybody have a ready answer?
 
Back
Top