User Defined Name Space ERROR

  • Thread starter vengala s reddy
  • Start date
V

vengala s reddy

i created a class1.vb, created a class1.dll.
now i moved it to \bin directory.
and to webconfig file i added
<compilation>
<add assembley="*"/>
</compilation>

Now i am trying to use it it in test.aspx
<%@ Import Namespace="HelloWorld" %>

ERROR GOES LIKE THIS
Compiler Error Message: BC30466: Namespace or type 'HelloWorld' for
the Imports 'HelloWorld' cannot be found.
Source Error:
Line 12: Option Explicit On
Line 13:
Line 14: Imports HelloWorld
Line 15: Imports Microsoft.VisualBasic
Line 16: Imports System

I NEED YOUR HELP. THX
 
K

Kevin Spencer

Sounds like you're using Visual Studio.Net. If so, take a look at the tab
under the "Solution Explorer" tab, which is usually the "Class View" tab. It
shows a hierarchical representation of your namespaces and classes. I would
strongly suspect that, as you are using VB. your top-level NameSpace for
your class is "class1" and that your reference to it should be
"class1.HelloWorld". By default, Visual Studio.Net, when working with VB.Net
projects, will name the top-level NameSpace for that project with the name
of the project/dll, and it will not appear in the code, but in the Project
Properties.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
M

Martin Dechev

Hi, vengala s reddy,

You should add a reference to your assembly to the project. The project is
the one that gets compiled. It is not enough to add the compilation section
to the web.config as the web.config has nothing to do with the compilation
of the project. The compiler gets the info regarding the references from the
project settings.

Greetings
Martin
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top