Bug in aspnet_compiler?

Discussion in 'ASP .Net' started by =?Utf-8?B?U2FtNzc3?=, Nov 28, 2005.

  1. Our global.asax file has the following line:
    <OBJECT ID="sInfo" RUNAT="Server" SCOPE="Session" CLASS="a.b.c.d"></OBJECT>

    This is referred to in other places in global.asax and other pages by just
    sInfo e.g. sInfo.ToString(). This works when deploying the raw pages but a
    compiled site fails. Reflector shows that in the working case, the class
    corresponding to global.asax has:
    private a.b.c.d sInfo {
    get {
    return (a.b.c.d)Session.StaticObjects.GetObject("sInfo");
    }
    }

    whereas the precompiled class has an sInfo member which is obviously not the
    same thing.

    I can replace the OBJECT tag with the property but this does not fix the
    references in other pages. Is there an easier way to do this than changing
    all references to (a.b.c.d)Session["sInfo"]?
     
    =?Utf-8?B?U2FtNzc3?=, Nov 28, 2005
    #1
    1. Advertising

  2. Hi Sam,

    Welcome to ASPNET newsgroup.
    Regarding on the problem you met when using <object runat=server...> tag in
    asp.net 2.0 global.asax, it is the expected behavior according to the new
    ASP.NET 2.0 applicaiton compilation model. In asp.net 2.0 we support purely
    dynamic compilation of contents, so any source file (code behind) or
    component code files (in app_code dir) will be dynamically compiled on
    demand and the globa.asax will be dynamically compiled into a certain
    class, also source code files in different foders are by default compiled
    into separate assemblies... And as for the <object ..runat=server... >
    tag, it is used to provide backward compatibility to classic ASP style COM
    object initializing, in the asp.net 2.0 compilation model, it'll be
    compiled into class as a private member (since no accesor flag is
    specified.....).

    So in ASP.NET we're recommended to upgrate such style <tag> to serverside
    ..net code. We can create and initilize COM components in page's code behind
    or global class's certain event handler.... And we can explicitly declare
    static or member field or property (with public accesor...) on our global
    class so that we can access them in otther place (page or handler ) during
    runtime...

    Thanks,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)


    --------------------
    | Thread-Topic: Bug in aspnet_compiler?
    | thread-index: AcX0LqaD5urx8E6ETWOl+9n+Ww647w==
    | X-WBNR-Posting-Host: 32.112.128.18
    | From: =?Utf-8?B?U2FtNzc3?= <>
    | Subject: Bug in aspnet_compiler?
    | Date: Mon, 28 Nov 2005 07:16:04 -0800
    | Lines: 19
    | Message-ID: <>
    | MIME-Version: 1.0
    | Content-Type: text/plain;
    | charset="Utf-8"
    | Content-Transfer-Encoding: 7bit
    | X-Newsreader: Microsoft CDO for Windows 2000
    | Content-Class: urn:content-classes:message
    | Importance: normal
    | Priority: normal
    | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    | Newsgroups: microsoft.public.dotnet.framework.aspnet
    | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
    | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
    | Xref: TK2MSFTNGXA02.phx.gbl
    microsoft.public.dotnet.framework.aspnet:361257
    | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    |
    | Our global.asax file has the following line:
    | <OBJECT ID="sInfo" RUNAT="Server" SCOPE="Session"
    CLASS="a.b.c.d"></OBJECT>
    |
    | This is referred to in other places in global.asax and other pages by
    just
    | sInfo e.g. sInfo.ToString(). This works when deploying the raw pages but
    a
    | compiled site fails. Reflector shows that in the working case, the class
    | corresponding to global.asax has:
    | private a.b.c.d sInfo {
    | get {
    | return (a.b.c.d)Session.StaticObjects.GetObject("sInfo");
    | }
    | }
    |
    | whereas the precompiled class has an sInfo member which is obviously not
    the
    | same thing.
    |
    | I can replace the OBJECT tag with the property but this does not fix the
    | references in other pages. Is there an easier way to do this than
    changing
    | all references to (a.b.c.d)Session["sInfo"]?
    |
     
    Steven Cheng[MSFT], Nov 29, 2005
    #2
    1. Advertising

  3. > Regarding on the problem you met when using <object runat=server...> tag in
    > asp.net 2.0 global.asax, it is the expected behavior according to the new
    > ASP.NET 2.0 applicaiton compilation model.


    That doesn't quite explain why the behaviour is different when deploying the
    pages vs precompilation :) However, if you're recommending that people stop
    using those tags then that's exactly what we'll do and hence problem solved.

    Thanks,
    Sam.
     
    =?Utf-8?B?U2FtNzc3?=, Nov 29, 2005
    #3
  4. Thanks for your response Sam,

    En, the difference is possible caused by the internal implementation of the
    ASP.NET runtime compilation and code generation service... However, most
    of the behavior between pure dynamic compiled assembly and precompiled ones
    should be identical. Anyway, upgrated to use the new code model in .NET
    world is the most recommended. :)

    Thanks again for your posting.

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
    --------------------
    | Thread-Topic: Bug in aspnet_compiler?
    | thread-index: AcX03WjeZ3LAiJXzT7CyOC9RHksmJQ==
    | X-WBNR-Posting-Host: 32.112.128.18
    | From: =?Utf-8?B?U2FtNzc3?= <>
    | References: <>
    <>
    | Subject: RE: Bug in aspnet_compiler?
    | Date: Tue, 29 Nov 2005 04:07:03 -0800
    | Lines: 10
    | Message-ID: <>
    | MIME-Version: 1.0
    | Content-Type: text/plain;
    | charset="Utf-8"
    | Content-Transfer-Encoding: 7bit
    | X-Newsreader: Microsoft CDO for Windows 2000
    | Content-Class: urn:content-classes:message
    | Importance: normal
    | Priority: normal
    | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    | Newsgroups: microsoft.public.dotnet.framework.aspnet
    | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
    | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA03.phx.gbl
    | Xref: TK2MSFTNGXA02.phx.gbl
    microsoft.public.dotnet.framework.aspnet:361447
    | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    |
    | > Regarding on the problem you met when using <object runat=server...>
    tag in
    | > asp.net 2.0 global.asax, it is the expected behavior according to the
    new
    | > ASP.NET 2.0 applicaiton compilation model.
    |
    | That doesn't quite explain why the behaviour is different when deploying
    the
    | pages vs precompilation :) However, if you're recommending that people
    stop
    | using those tags then that's exactly what we'll do and hence problem
    solved.
    |
    | Thanks,
    | Sam.
    |
     
    Steven Cheng[MSFT], Nov 30, 2005
    #4
    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. =?Utf-8?B?R2lsbGVz?=

    [ASP 2.0] Site deployment and aspnet_compiler questions

    =?Utf-8?B?R2lsbGVz?=, Nov 20, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    484
    =?Utf-8?B?R2lsbGVz?=
    Nov 20, 2004
  2. Ajay
    Replies:
    0
    Views:
    568
  3. CuriousGeorge

    aspnet_compiler - exclude files

    CuriousGeorge, Mar 27, 2006, in forum: ASP .Net
    Replies:
    5
    Views:
    3,134
    Mark Rae
    Mar 28, 2006
  4. =?Utf-8?B?Y3Nya2luZw==?=

    aspnet_compiler outputs non-runtime files?

    =?Utf-8?B?Y3Nya2luZw==?=, Apr 7, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    831
    =?Utf-8?B?Y3Nya2luZw==?=
    Apr 7, 2006
  5. yousry
    Replies:
    0
    Views:
    953
    yousry
    Apr 12, 2006
Loading...

Share This Page