Type not Defined. Going crazy!

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • shapper

    Type not Defined. Going crazy!

    Hello,

    On an ASP.NET 3.5 web site App_Code folder I have a class named
    BoxesView under the namespace Engine.

    On an aspx page code behind I have the following:

    Protected WithEvents c As New Engine.BoxesVie w

    Then I added it to the page. BoxesView inherits composite control.

    I don't get any error when I write my code. However when I build the
    web site I sometimes get the following error:

    Compiler Error Message: BC30002: Type 'BoxesView' is not defined.

    Sometimes the page runs fine sometimes I get the error.

    I don't make any changes ... I have no idea why this is happening!

    I am on this for 2 hours.

    Why does my page either runs or display an error?

    And why I don't get any error in my code but only when sometimes when
    I run my page or build the web site?

    I am using VS 2008.

    Thanks,

    Miguel
  • Mark Fitzpatrick

    #2
    Re: Type not Defined. Going crazy!

    Miguel,
    It can be very tricky to work with the VS Web Site Projects. I always use
    the Web Application Project for exactly this reason since it all compiles
    into a single DLL instead of many dlls. Make sure that you are also
    importing the namespace correctly for your class that is coming from the
    App_Code folder.

    Hope this helps,
    Mark Fitzpatrick
    Microsoft MVP - Expression

    "shapper" <mdmoura@gmail. comwrote in message
    news:d57c28fc-f445-426a-8104-1d399ee3562c@m3 6g2000hse.googl egroups.com...
    Hello,
    >
    On an ASP.NET 3.5 web site App_Code folder I have a class named
    BoxesView under the namespace Engine.
    >
    On an aspx page code behind I have the following:
    >
    Protected WithEvents c As New Engine.BoxesVie w
    >
    Then I added it to the page. BoxesView inherits composite control.
    >
    I don't get any error when I write my code. However when I build the
    web site I sometimes get the following error:
    >
    Compiler Error Message: BC30002: Type 'BoxesView' is not defined.
    >
    Sometimes the page runs fine sometimes I get the error.
    >
    I don't make any changes ... I have no idea why this is happening!
    >
    I am on this for 2 hours.
    >
    Why does my page either runs or display an error?
    >
    And why I don't get any error in my code but only when sometimes when
    I run my page or build the web site?
    >
    I am using VS 2008.
    >
    Thanks,
    >
    Miguel

    Comment

    Working...