I get this error when pushing our website to our clients production server however the page works absolutely fine on their dev / test servers. What causes this error (considering I am not using any web resources myself, though I am using the asp.net ajax toolkit).
-
what is ur website link? will read what message u getting? – Muhammad Akhtar Jul 08 '09 at 11:38
-
Yep IIS running fine, unfortunatly I cant give you the link. – januszstabik Jul 09 '09 at 09:28
-
I think the server is stripping out query string parameters so effectively the .axd files are being requested without the necessary data (which in turn generates a 404). I think this as my web services (.asmx) are not working either, they behave as they do if you don't pass in any qs params. – januszstabik Jul 09 '09 at 09:30
-
even i am receiving same error and my observation is, it is done by some spammer, they are making request call automatically with different IP, any idea how can i stop this? – Jordon Willis Jun 04 '11 at 21:53
5 Answers
Can you get a full stack trace on this error? There will be one in the server event log (system or application, can't remember which)?
There are various parts of ASP.NET that use script resources, and at least two slightly obscure causes of them failing with this sort of error I can think of.
- believe it or not, if your dlls have embedded resources in them, and they are dated in the future this will happen (if you ever compile dlls in the UK and then immediately deploy them to US web servers you'll be well aware of this issue!). I can't remember the event log error this shows, but would know if I saw it - and it is not immediately obvious.
- if you have a load balancer routing requests between multiple servers without being "sticky", and your servers have different machine keys, then the request will fail because the encrypted querystring identifying the resource will not be decryptable on another server. This will cause a stack trace that includes various crypto types in it.
There are lots of other causes (such as incorrect uris, or querystrings getting corrupted as mentioned above), but having a full stack trace will help here.

- 14,697
- 4
- 41
- 54

- 40,328
- 13
- 85
- 111
-
Are you able to tell me where the machine key is stored, and is there an issue with having the same key on all servers in the farm? – Brettski Nov 03 '11 at 19:52
-
Found what I needed in this link: http://msdn.microsoft.com/en-us/library/ff649308.aspx. basically the values are stored at machine level in web.config.comments – Brettski Nov 03 '11 at 20:58
-
Load balancing with machine key fixed my issue. Everything else was working because of the SQL session state. – Dustin Brooks Feb 05 '14 at 21:03
-
I get the **same error** _This is an invalid script resource request_ in webFarm with F5 LoadBalancing there are 3 IIS servers with the ***same machineKey*** `
` – Kiquenet Nov 04 '15 at 10:15
The error in the end was due to some URL re-writing that was occuring the server to which the admins hadn't told us about.! Watch out for that one

- 1,152
- 5
- 16
- 30
I used to get this annoying error all the time. Users are indeed affected by this error. We used to get complaints of pages not loading properly. After trying many things like adding DOCTYPE
the error did not go away completely. Then we tried storing all the VIEWSTATE
in session. Violà no more errors. If your application has a bloated view state like ours then you will see this error in the logs. Often.

- 12,864
- 16
- 78
- 107

- 1,485
- 1
- 16
- 15
-
1Absolutely awful, the viewstate isn't stored in the session because then all form data would be stored in RAM, not to mention when to remove the old viewstate, you don't want that having two webforms open at once causes one to loose its viewstate. So then when do you remove it, at session end? – Aidiakapi Jul 05 '11 at 11:49
-
I store ViewState in a dictionary object, with time stamp and page name as a key. Key goes to the webpage, and KVP stays in server memory. and expire the ViewState after certain amount of time. This is a temp solution till I work my pages to have as little ViewState as possible. Awful? true, does it works? Yes! – coderman Jul 06 '11 at 02:52
-
Does it work: until your site user count goes over a few thousand, yeah, beyond that, unpredictable results due to data loss/`OutOfMemoryException`. – Aidiakapi Jul 06 '11 at 11:25
-
1Aidiakapi, many who want a serious front facing website and started using Asp.Net WebForms at the beginning (and now they can't migrate to MVC or other more professional frameworks) had to resort to this. I have a site with quite a few daily thousands users and my aspnet_state.exe is using only 200Mb of Ram. My w3wp.exe on the contrary is using 800Mb. The total amount of RAM in my server is 32Gb so that doesn't make much of a difference. What is the alternative you propose? do you really agree with Microsoft that in EVERY GET and POST request you should send and receive a bloated Viewstate? – Durden81 Oct 21 '11 at 13:41
If indeed you are using multiple servers try the following: Add to your web.config:
<machineKey
validationKey="21F090935F6E49C2C797F69BBAAD8402ABD2EE0B667A8B44EA7DD4374267A75D7
AD972A119482D15A4127461DB1DC347C1A63AE5F1CCFAACFF1B72A7F0A281B"
decryptionKey="ABAA84D7EC4BB56D75D217CECFFB9628809BDB8BF91CFCD64568A145BE59719F"
validation="SHA1"
decryption="AES"
/>
But generate the validationKey and decryptionKey yourself using the code examples found here: http://msdn.microsoft.com/en-us/library/ms998288.aspx The above link also explains more about this solution so check it out, look for Web Farm Deployment Considerations on that page

- 4,150
- 3
- 37
- 47
You can check the urls which were generating this error. Web resources (used by the Ajax Toolkit) rely on a query string argument. If that argument is altered in some way (perhaps by some malicious user) the HTTP handler will throw exception that it cannot find the requested web resource.

- 30,562
- 8
- 59
- 93