Re: aspx file named "object" - now Global.asax does not load

Discussion in 'ASP .Net' started by bruce barker, Feb 5, 2004.

  1. bruce barker

    bruce barker Guest

    naming a webform Object.aspx, creates a class called Object, which will hide
    the System.Object class, and cause some problems. Stay away from naming
    stuff the same as System classes.

    -- bruce (sqlwork.com)


    "john_ca @hotmail.com>" <john_murray_sp<remove> wrote in message
    news:...
    > Added a Webform to existing project and named the file "Object.aspx".
    >
    > After that the Global.asax did not load (or at least the 'Session_start'

    method did not fire). This occured both with running the application or
    debugging from within Visual Studio (e.g. breakpoint within Session_start
    was not hit).
    >
    > Removed the offending file and all was well.
    >
    > Any thoughts?
    >
    >
    > Environment:
    > Windows 2000 SP3
    > .NET Framework version v1.1.4322
    > Visual Studio .NET 2003
    > IE 6.0.2800.1106
    >
    bruce barker, Feb 5, 2004
    #1
    1. Advertising

  2. I believe it should not be the problem.
    Since it's only humans understand Short Names.
    Compiler always compiles with fully qualified name like System.Object and
    there is no way that runtime will confuse MyProject.Object with
    System.Object.

    But i lived long enough to know that everything is possible :)
    But i would check twice before accept this theory.

    George.


    "bruce barker" <> wrote in message
    news:...
    > naming a webform Object.aspx, creates a class called Object, which will

    hide
    > the System.Object class, and cause some problems. Stay away from naming
    > stuff the same as System classes.
    >
    > -- bruce (sqlwork.com)
    >
    >
    > "john_ca @hotmail.com>" <john_murray_sp<remove> wrote in message
    > news:...
    > > Added a Webform to existing project and named the file "Object.aspx".
    > >
    > > After that the Global.asax did not load (or at least the 'Session_start'

    > method did not fire). This occured both with running the application or
    > debugging from within Visual Studio (e.g. breakpoint within Session_start
    > was not hit).
    > >
    > > Removed the offending file and all was well.
    > >
    > > Any thoughts?
    > >
    > >
    > > Environment:
    > > Windows 2000 SP3
    > > .NET Framework version v1.1.4322
    > > Visual Studio .NET 2003
    > > IE 6.0.2800.1106
    > >

    >
    >
    George Ter-Saakov, Feb 5, 2004
    #2
    1. Advertising

  3. I agree. But in any case, Microsoft should save us from ourselves (and our mis-guided naming decisions). The compiler should warn us that it cannot resolve the name..

    I still think it's a bug, and with interesting behaviour..

    ----- George Ter-Saakov wrote: ----

    I believe it should not be the problem
    Since it's only humans understand Short Names
    Compiler always compiles with fully qualified name like System.Object an
    there is no way that runtime will confuse MyProject.Object wit
    System.Object

    But i lived long enough to know that everything is possible :
    But i would check twice before accept this theory

    George


    "bruce barker" <> wrote in messag
    news:..
    > naming a webform Object.aspx, creates a class called Object, which wil

    hid
    > the System.Object class, and cause some problems. Stay away from namin
    > stuff the same as System classes
    >> -- bruce (sqlwork.com
    >>> "john_ca @hotmail.com>" <john_murray_sp<remove> wrote in messag

    > news:..
    >> Added a Webform to existing project and named the file "Object.aspx"
    >>>> After that the Global.asax did not load (or at least the 'Session_start

    > method did not fire). This occured both with running the application o
    > debugging from within Visual Studio (e.g. breakpoint within Session_star
    > was not hit)
    >>>> Removed the offending file and all was well
    >>>> Any thoughts
    >>>>>> Environment

    >> Windows 2000 SP
    >> .NET Framework version v1.1.432
    >> Visual Studio .NET 200
    >> IE 6.0.2800.110
    >>>>
    =?Utf-8?B?am9obl9jYQ==?=, Feb 6, 2004
    #3
    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. Daniel Bass
    Replies:
    2
    Views:
    6,857
    Daniel Bass
    Dec 31, 2003
  2. Scott M.
    Replies:
    0
    Views:
    358
    Scott M.
    Feb 5, 2004
  3. Tommy
    Replies:
    0
    Views:
    385
    Tommy
    Feb 5, 2004
  4. =?Utf-8?B?YmNoYXJsZXM=?=

    global.asax and global.asax.cs

    =?Utf-8?B?YmNoYXJsZXM=?=, Oct 4, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    800
    =?Utf-8?B?YmNoYXJsZXM=?=
    Oct 5, 2004
  5. Mark Rae

    Global.asax / Global.asax.cs in v2

    Mark Rae, May 23, 2006, in forum: ASP .Net
    Replies:
    6
    Views:
    3,137
    Mark Rae
    May 23, 2006
Loading...

Share This Page