469,903 Members | 2,173 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,903 developers. It's quick & easy.

Namespace changing case?

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.
Nov 20 '05 #1
1 1868
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.

"Phill. W" <P.******@open.ac.uk> wrote in message
news:bk**********@yarrow.open.ac.uk...
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.

Nov 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

88 posts views Thread by Tim Tyler | last post: by
20 posts views Thread by Bernd Fuhrmann | last post: by
7 posts views Thread by zbyszek | last post: by
20 posts views Thread by Patrick Guio | last post: by
6 posts views Thread by Robert Warnestam | last post: by
13 posts views Thread by toton | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.