Namespace changing case?

  • Thread starter Thread starter Phill. W
  • Start date Start date
P

Phill. W

Having changed a VB.Net(2003) DLL project, I'm getting Type
Loading problems in other code that uses my DLL. In my source
code, I have a Namespace Statement something like this:

Namespace XYZ.AProject

but when I build the DLL project and open the resulting DLL up
in ILDASM, the Namespace has been *translated* to
"XYZ.Aproject".

(Start of ILDASM Dump)

___[MOD] ...\AProject\MyClass\bin\XYZ.AProject.MyClass.dll
| M A N I F E S T
|___[NSP] XYZ.Aproject
.. . .

As you can imagine, this is causing huge problems as the new
version of my assembly is breaking all the other code compiled
against the previous version.
Please note: I've compiled this project *many* times before and
this is the first time I've seen this problem) and no; I don't want to
create a new assembly version; older code MUST use the new code (there's a
rather nasty bug in the old one).

I've already compared all the source files and none of them show
a change to the Namespace statement, nor does the
"case-converted" form of the namespace appear anywhere
(except in the compiled DLL!).

Any ideas what might be causing this?

TIA,
Phill W.
 
I /think/ I've found what's causing this. The confusion arose
because of inconsistent use of Namespace statements.

Some developers used

Namespace XYZ.AProject

while others used

Namespace XYZ.Aproject

It appears that Referencing an assembly with the "same"
namespace (but in a different *case*) *overrides* the
Namespace statement in your own code.

Even more annoyingly, it seems that when adding a reference,
VB.Net 2003 seems to take the Assembly Name from the name
of the physical file /containing/ the assembly! So, when I added
a reference to the assembly

XYZ.AProject.Assembly1

contained in the physical file

XYZ.Aproject.Assembly1.dll

VB.Net dutifully saved the vbproj file containing

.. . .
<Reference
Name = "XYZ.Aproject.Assembly1"
AssemblyName = "XYZ.Aproject.Assembly1"
HintPath = . . .
/>
.. . .

Much confusion, but at least I'm up and running again.

Regards,
Phill W.
 
Back
Top