By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,190 Members | 1,056 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,190 IT Pros & Developers. It's quick & easy.

BC30466: Namespace or type cannot be found - different approach!

P: n/a
Hi All,

I have searched for this problem but unusually have had no luck!

I have an .vb file in the code directory with the following simplified
code in it:

Namespace MyTest
Public Class returnClass
Public Shared Function returnString() As String
Return "test"
End Function
End Class
End Namespace

I now want to import this class into an aspx file. My .net
intellisense picks up the namespace and class and allows me to import
it as follows:

Imports MyTest.returnClass

and kicks out zero errors!

When I fire up the aspx page I get the 'dreaded':-

Compiler Error Message: BC30466: Namespace or type 'returnClass' for
the Imports 'MyTest.returnClass' cannot be found.

Note: The .vb file is not compiled but should compile at run time,
provided it is in the /code directory, should'nt it?

Help will be appreciated as would donations!
Nov 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
If you are using source file in the /code directory
of your application, you don't need to import the
classes in the source files to your aspx files.

You can just reference them in your aspx file,
and they will work without references!

Visual Studio monitors the /Code directory and when
new components are added, compiles them.

The components in the Code subdirectory are
compiled by default into a single assembly.

The assembly is then automatically referenced
in the project and available to all pages in the site.

Eliminate :
Imports MyTest.returnClass and everything should work
[ unless you have other errors, of course... ;-) ]

Juan T. Llibre
ASP.NET MVP
===========
"sorCrer" <ju**@spirit.co.za> wrote in message
news:dc**************************@posting.google.c om... Hi All,

I have searched for this problem but unusually have had no luck!

I have an .vb file in the code directory with the following simplified
code in it:

Namespace MyTest
Public Class returnClass
Public Shared Function returnString() As String
Return "test"
End Function
End Class
End Namespace

I now want to import this class into an aspx file. My .net
intellisense picks up the namespace and class and allows me to import
it as follows:

Imports MyTest.returnClass

and kicks out zero errors!

When I fire up the aspx page I get the 'dreaded':-

Compiler Error Message: BC30466: Namespace or type 'returnClass' for
the Imports 'MyTest.returnClass' cannot be found.

Note: The .vb file is not compiled but should compile at run time,
provided it is in the /code directory, should'nt it?

Help will be appreciated as would donations!

Nov 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.