Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > BC30466: Namespace or type cannot be found - different approach!

Reply
Thread Tools

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

 
 
sorCrer
Guest
Posts: n/a
 
      01-19-2005
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!
 
Reply With Quote
 
 
 
 
Juan T. Llibre
Guest
Posts: n/a
 
      01-19-2005
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) 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!



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ERROR CS0234: The type or namespace name 'DataAccessHelper' does not exist in the namespace 'BCC' (are you missing an assembly reference?) li.eddie@gmail.com ASP .Net 0 01-06-2006 11:31 AM
Namespace or type '...' for the Imports '...' cannot be found Stephen Cochran ASP .Net 4 07-22-2004 09:51 PM
Namespace not found in aspx but IS found in code behind William Parker ASP .Net 1 06-27-2004 06:13 AM
BC30466: Namespace or type 'test' for the Imports 'test' cannot be found. Sting ASP .Net 5 06-08-2004 06:16 AM
Namespace cannot be found? Help! ASP .Net 1 11-24-2003 05:21 AM



Advertisments