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

Discussion in 'ASP .Net' started by sorCrer, Jan 19, 2005.

  1. sorCrer

    sorCrer Guest

    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!
    sorCrer, Jan 19, 2005
    #1
    1. Advertising

  2. 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" <> wrote in message
    news:...
    > 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!
    Juan T. Llibre, Jan 19, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sting
    Replies:
    5
    Views:
    1,612
    Natty Gur
    Jun 8, 2004
  2. William Parker
    Replies:
    1
    Views:
    3,076
    Martin
    Jun 27, 2004
  3. Stephen Cochran
    Replies:
    4
    Views:
    3,477
    Chris R. Timmons
    Jul 22, 2004
  4. =?Utf-8?B?R2Vvcmdl?=

    BC30466: Error in reference to System.Data.OracleClient

    =?Utf-8?B?R2Vvcmdl?=, Jan 5, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    429
    =?Utf-8?B?R2Vvcmdl?=
    Jan 5, 2005
  5. Phil Certain
    Replies:
    2
    Views:
    1,006
Loading...

Share This Page