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

  • Thread starter Thread starter sorCrer
  • Start date Start date
S

sorCrer

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!
 
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
===========
 
Back
Top