Namespace Problem

  • Thread starter Thread starter rufus
  • Start date Start date
R

rufus

I created an assembly called : getDataVB.dll and placed it in the bin
folder. The source file getData.vb looks like this:

Namespace chris.getData
Public Class dataObj
' my code
End Class
End Namespace

it compiles with no problems. I have a code behind file where I import this
namespace like this: Imports chris.getData
When I type this import statement, VS completes it automatically so I know
that it is properly registered. When I try to create a new instance of the
dataObj class like this: Dim dataObj as new DataObj I get the error message:
'dataObj' is ambiguous in the namespace 'chris.getData'. I have also added
this line to my web.config file: <add assembly="getDataVB"/>

I am using Visual Web Developer 2005 Express Edition Beta and compiling my
classes using vbc on the compiler version 1.1.4322.573.

Can anyone tell me what the problem might be?

Thanks
 
Rufus,
It sounds like you included the getData.vb source file in your web project
as well as your class library project. It needs to be in only your class
library project.

Hope this helps
Jay
 
Jay B. Harlow said:
Rufus,
It sounds like you included the getData.vb source file in your web project
as well as your class library project. It needs to be in only your class
library project.

Hope this helps
Jay

Thanks for your reply but I'm not sure that this is the problem. Visual
Webdeveloper doesn't seem to make projects and all class files must be
assembled from the command line.
 
rufus,
Is getData.vb in the same folder as your web application (the Code folder)?

If it is then it is automatically part web application you do not need to
use the command line to create an assembly.

Hence it sounds like you include the getData.vb source file in your web
project (application if you prefer) as well as your class library project
(assembled from the command line).

Hope this helps
Jay
 
Doh!
If it is then it is automatically part web application you do not need to
use the command line to create an assembly.
That should be:

If it is then it is automatically part of the web application you do not
need to use the command line to create an assembly.

Hope this helps
Jay
 
Jay B. Harlow said:
Doh!
That should be:

If it is then it is automatically part of the web application you do not
need to use the command line to create an assembly.

Hope this helps
Jay

Thanks for your help Jay. It worked! I have always thought I needed a dll
sitting in the bin folder and Visual Studio normally creates one
automatically.
 
Back
Top