Framework Version Problem

Discussion in 'ASP .Net' started by Al Smith, Oct 11, 2004.

  1. Al Smith

    Al Smith Guest

    Hi,



    Two developers installed 2005 beta on their machines along side .net 2003.
    Part of our web application then started behaving strangely, for them.



    We ran aspnet_regiis to force version 1.1 of the framework for them. It
    corrected one (a 2003 machine) of the two machines. The machine the problem
    did not correct using aspnet_regiis was a 2000 OS based (note that the app
    mappings were changed to 1.1 from 2.0 on the machine, the problem still
    existed though).



    The problem occurs specifically in our .net dll that is called from
    vb/interop and asp (not aspx) page. In my research I found an "app config"
    setting to force a certain version of the runtime but I am not sure if this
    also works for a web app. What I found in this regard is below:

    <configuration>

    <startup>

    <supportedRuntime version="v1.1.4322"/>

    </startup>

    <system.web>

    ...

    </system.web>

    </configuration>



    Is there a way to force the .net dll to run under 1.1 of the framework and
    is there a way to verify what version of the framework the dll is loading
    under?



    Thanks very much!



    Al
    Al Smith, Oct 11, 2004
    #1
    1. Advertising

  2. Hi Al,

    From your description, you have a win2k machine which has .net framework
    1.1 and 2.0(later) installed. And there is a .net assembly which is build
    under 1.1 and is used in some CLASSIC asp pages. However, you found it not
    work correctly in asp pages, yes?

    Since you also mentioned that the problem only occurs when you call the
    assemlby through COM interop in asp rather than in .net application(both
    windows or asp.net) , yes? Based on my research, this is the normal
    behavior of the .net CLR 's runtime version locating. Here is the different
    scenarios:
    1. For windows application(winform or console), we can use app.exe.config
    file to speicfy the runtime version to use via the <supportedRuntime>
    element such as:
    <startup>
    <supportedRuntime version="v1.1.4322" />
    </startup>
    #NOTE that application config file is applicatoin based (not assembly based)

    2. AS for asp.net , we need to swtich the ASP.NET'S ISAPI filter in IIS
    mangement console (config file is not work)

    3. As for the CLASSIC ASP or other unmanaged application that use .net
    assmelby via COM interop, by default , if we didn't explicitly do any
    specification on runtime version, it will use the latest version available
    on the machine. (I think this is the cause of your problem). And we can
    also use an app.exe.config file to specify the runtime version.

    Please have a look at the following msdn article, it has detailed explain
    this:

    #Side-by-Side Execution of the .NET Framework
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetdep/ht
    ml/sidexsidenet.asp

    However, our problem is that we called the assembly in ASP(really seldom
    encounter such scenairo), generally ASP will run in the DLLHOST.EXE, but
    there is also other alternative approachs to change this behavior. So I
    suggest you first check whether the DLLHOST is the process which host your
    asp apps, then provide a dllhost.exe.config file for it (which contains the
    runtime specify info).

    Below is anothe tech article on ASP's application runtime context:

    #HOW TO: Run Applications Not in the Context of the System Account in IIS
    http://support.microsoft.com/?id=319067

    Hope also helps. If you found the above suggestion still not work, please
    feel free to let me know or provide the further info on or concern and I'll
    do some further research to help you .

    Regards,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
    Steven Cheng[MSFT], Oct 12, 2004
    #2
    1. Advertising

  3. Al Smith

    Al Smith Guest

    Hi Steven,

    Thanks for your suggestions! We did go down the path as mentioned in the
    side-by-side article. However, we were hoping that a more granular option
    might be available, which I guess is not the case. Our .net dll is being
    loaded under dllhost.exe as you surmised.

    So I am left with two questions:
    1) Is there a way to detect what version of the framework a .net dll module
    loads under?
    2) Do you have a link that can explain what is different about using 2003 as
    the OS and why aspnet_regiis does correct the complete issue when using it
    to set 1.4 version of the framework? If this question is not clear, refer
    back to the original post.

    Thanks again Steven,
    Al
    Al Smith, Oct 12, 2004
    #3
  4. Hi Al,

    Thanks for your followup.
    As for the two questions you mentioned, here are my understandings:
    1. There is not buildin means that exactly for getting the CLR runtime
    version where the currently assembly or application run against. It all
    depends, for example, the default maybe the version of the assembies you
    referenced agains when you compile your component. And we can change this
    by using the application configure file.(via <supportRuntime> element)
    And we can try using the Assembly.ImageRuntimeVersion to get the clr
    runtime version from the certain assembly's manifest. For example:

    typeof(System.String).Assembly.ImageRuntimeVersion.ToString()

    Also ,here is a blog article discussing on
    this:http://blogs.msdn.com/suzcook/archive/2003/06/20/57191.aspx


    2. The reason why the "aspnet_regiis " work on 2003 but not on 2k may
    caused by the different processModel between them. On 2K machine, the
    ASP.NET run in the managed aspnet_wp workerprocess and get request from
    the aspnet_isapi filter in iis. And the CLASSIC ASP pages are processed in
    the DLLHOST.EXE separately from the aspnet. However, on 2003, Both ASP and
    asp.net are hosted in the W3WP.EXE proecess. Since when you use the
    aspnet_regiis , the asp.net is forced to use the 1.1 version, so when the
    asp pages are processed in the w3wp worker process, it will also using the
    1.1 runtime. Do you think so?

    The following article has mentioned the asp.net architecture on both 2000
    and 2003
    #Hosting Multiple ASP.NET Applications
    http://msdn.microsoft.com/library/en-us/secmod/html/secmod93.asp?frame=true


    Anyway, I'll also consult some further experts to see whether there're any
    other means rather than speicfying runtime version for the dllhost and will
    update you if I got any information.
    If you have anyother ideas, please also feel free to post here. Thanks.

    Regards,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
    Steven Cheng[MSFT], Oct 13, 2004
    #4
  5. Al Smith

    Al Smith Guest

    Hi Steven,

    Thanks so much for the information and links where I can go learn.

    > 2. The reason why the "aspnet_regiis " work on 2003 but not on 2k may
    > caused by the different processModel between them. On 2K machine, the
    > ASP.NET run in the managed aspnet_wp workerprocess and get request from
    > the aspnet_isapi filter in iis. And the CLASSIC ASP pages are processed in
    > the DLLHOST.EXE separately from the aspnet. However, on 2003, Both ASP and
    > asp.net are hosted in the W3WP.EXE proecess. Since when you use the
    > aspnet_regiis , the asp.net is forced to use the 1.1 version, so when the
    > asp pages are processed in the w3wp worker process, it will also using the
    > 1.1 runtime. Do you think so?


    Yes, this makes much sence.

    > Anyway, I'll also consult some further experts to see whether there're any
    > other means rather than speicfying runtime version for the dllhost and

    will
    > update you if I got any information.


    This is not a high priority issue now that we have a much better
    understanding of the issues. Hopefully a new beta of 2005 will come shortly
    and our strangeness will have been solved by it.

    Thanks again!

    Al
    Al Smith, Oct 13, 2004
    #5
  6. Hi Al,

    Thanks a lot for your followup. Anyway, I'll still try have a consult to
    see whether there is any new values we can find.( I"m also interested in
    anyother means to configure such unmanaged application as ASP :) ). I'll
    post the update here later, please feel free to look here or post any
    further feedbacks.


    Regards,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
    Steven Cheng[MSFT], Oct 14, 2004
    #6
  7. Al Smith

    Al Smith Guest

    Hi Steven,

    Thanks again, and I do scan the groups for all the "good stuff" they
    contain.

    I would guess that if something does not exist specifically from MS now that
    determines information about a loaded assembly, that someone will write
    something in the future. (Assuming it's not already out there somewhere.)

    Thanks again,

    Al
    Al Smith, Oct 14, 2004
    #7
  8. Thanks for the followup Al,

    And I suddently remind myself the "System.Environment.Version" property,
    have you also tried it, generally it is ok for retrieving the currently clr
    version the assembly is running against. Anyway, if there are any other
    things we can help, please feel free to post here. Thanks again for your
    posting.


    Regards,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
    Steven Cheng[MSFT], Oct 15, 2004
    #8
  9. Hi Al,

    After some further consulting, there seems haven't any further values
    currently. But if you meet any further problems later, please feel free to
    post here. We're willing to assist you. Thanks.

    Regards,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
    Steven Cheng[MSFT], Oct 18, 2004
    #9
  10. Al Smith

    Al Smith Guest

    Thanks for all your work and feedback Steven!

    Al

    "Steven Cheng[MSFT]" <> wrote in message
    news:...
    > Hi Al,
    >
    > After some further consulting, there seems haven't any further values
    > currently. But if you meet any further problems later, please feel free to
    > post here. We're willing to assist you. Thanks.
    >
    > Regards,
    >
    > Steven Cheng
    > Microsoft Online Support
    >
    > Get Secure! www.microsoft.com/security
    > (This posting is provided "AS IS", with no warranties, and confers no
    > rights.)
    >
    Al Smith, Oct 18, 2004
    #10
  11. You're welcome Al. Also, Thanks again for your understanding.

    Regards,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
    Steven Cheng[MSFT], Oct 19, 2004
    #11
    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. Shadow Lynx
    Replies:
    3
    Views:
    4,028
    Shadow Lynx
    Jan 30, 2006
  2. Replies:
    6
    Views:
    35,821
    tinvan
    Sep 21, 2006
  3. V Green
    Replies:
    0
    Views:
    827
    V Green
    Feb 5, 2008
  4. PA Bear [MS MVP]
    Replies:
    0
    Views:
    931
    PA Bear [MS MVP]
    Feb 5, 2008
  5. MowGreen [MVP]
    Replies:
    5
    Views:
    1,998
    PA Bear [MS MVP]
    Feb 9, 2008
Loading...

Share This Page