Results 1 to 10 of 10

Thread: [RESOLVED] Ajax / LoadBalancing / and the ScriptResource.axd File

  1. #1

    Thread Starter
    Fanatic Member VBCrazyCoder's Avatar
    Join Date
    Apr 2003
    Posts
    681

    [RESOLVED] Ajax / LoadBalancing / and the ScriptResource.axd File

    Hi all, here is my situation:

    I have Server1 and Server2 load balancing - I have an AJAX page that uses an ajax timer to check the status of something and update the UI with results.

    When I run the page specifying Server1 it works fine, likewise if I specify Server2. However, if I don't specify and I let the load balancer determine the server, all is well until one of the ajax postbacks goes to the alternate server - I then get the error message:

    "Sys.ScriptLoadFailedException. The script '/mysite/ScriptResource.axd?d=......" failed to load.


    When I enable script debugging in IE I get:


    "Missing call to Sys.Application.notifyScriptLoaded()"


    I made sure that the machinekeys are the same between both servers and ran a Fiddler trace to see what was going on - and the call to notifyscriptloaded does not occur when the ajax postback is routed to the other server after it has already hit the first server.

    My setup is ASP.net 2.0 on Server2003, the page in question has a masterpage, and the script manager is in the page within a content region.

    Anyone experience this or have a work-around. I don't think there is a way to tell it where to find the ScriptResource.axd file... Thanks for any help!
    Last edited by VBCrazyCoder; Feb 9th, 2009 at 07:54 PM.

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,173

    Re: Ajax / LoadBalancing / and the ScriptResource.axd File

    The /mysite/ seems to be using the virtual directory name in the path. This may mean that you have the same problem as this guy -

    http://plainoldstan.blogspot.com/200...sourceaxd.html

    His solution was to give both paths to the application on both servers the same virtual directory name.

  3. #3

    Thread Starter
    Fanatic Member VBCrazyCoder's Avatar
    Join Date
    Apr 2003
    Posts
    681

    Re: Ajax / LoadBalancing / and the ScriptResource.axd File

    I thought that too but my virtual directories are exactly the same on both machines.

  4. #4

    Thread Starter
    Fanatic Member VBCrazyCoder's Avatar
    Join Date
    Apr 2003
    Posts
    681

    [Resolved] Re: Ajax / LoadBalancing / and the ScriptResource.axd File

    [RESOLVED] Turns out that .net 2.0 added a "t" parameter to the path for the ScriptResource.axd file, so that had to match across servers.

  5. #5
    New Member
    Join Date
    Jun 2009
    Posts
    2

    Re: [RESOLVED] Ajax / LoadBalancing / and the ScriptResource.axd File

    How did you make sure that 't'e paramters are same in all servers.

    Did you add it to another server as well ?

  6. #6

    Thread Starter
    Fanatic Member VBCrazyCoder's Avatar
    Join Date
    Apr 2003
    Posts
    681

    Re: [RESOLVED] Ajax / LoadBalancing / and the ScriptResource.axd File

    Since the "t" parameter relates to the LastModifiedDate on the System.Web.Extensions.dll in the GAC, you must make sure that the date matches across the servers.
    You can view the dates using this (which also will show you the path):
    Code:
    Dim strFilePath As String = "C:\WINDOWS\assembly\gac_msil\system.Web.Extensions\1.0.61025.0__31bf3856ad364e35\System.Web.Extensions.dll"
    			Dim strFilePath2 As String = "C:\WINDOWS\assembly\gac_msil\System.Web.Extensions.Design\1.0.61025.0__31bf3856ad364e35\System.Web.Extensions.Design.dll"
    
    			MessageBox.Show("DT: " & File.GetLastWriteTime(strFilePath).ToString() & "  ||  Design file: " & File.GetLastWriteTime(strFilePath2).ToString())
    So just set them both to the exact same datetime and you should be good to go.

  7. #7
    New Member
    Join Date
    Jun 2009
    Posts
    2

    Resolved Re: [RESOLVED] Ajax / LoadBalancing / and the ScriptResource.axd File

    Thank you very much,

    I did find out that modified dates were wrong as the AJAX Control Tool Kit assemblies were in GAC.

    For a solution, I have put them on server's bin directory as copying them in bin directory does not change the modified date.

    Not sure why putting the file in GAC would change the modified date to a date when it was placed there.

    Anyway, I have a solution so its all fine.

    Thanks again for your help

  8. #8
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,532

    Re: [RESOLVED] Ajax / LoadBalancing / and the ScriptResource.axd File

    Because that's the GAC's way of saying "Hey the copy I haver is good as of the date it was dropped into here...." which means it's possible to load an older version of an assembly into the GAC.... ick... the implications of that...

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  9. #9
    New Member
    Join Date
    Dec 2007
    Location
    Buenos Aires
    Posts
    14

    Re: [RESOLVED] Ajax / LoadBalancing / and the ScriptResource.axd File

    I know this is an old thread, but I have the exact same issue in a W2k8 server cluster. An app deployed in both, using a load balancer.

    when you say:

    Quote Originally Posted by VBCrazyCoder View Post
    So just set them both to the exact same datetime and you should be good to go.
    What do you mean exactly? How do I "set the last modified datetime" to those files in the GAC??
    And.. the datetime has to match between System.Web.Extensions.dll and System.Web.Extensions.Design.dll? Or for those files between the servers??

    thanks

  10. #10
    New Member
    Join Date
    Jun 2015
    Posts
    1

    Re: [RESOLVED] Ajax / LoadBalancing / and the ScriptResource.axd File

    I've same problem like you, my friend fixed it ..


    ------------------
    Coque sony xperia z4
    Last edited by dance; Jun 5th, 2015 at 02:50 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width