System.Web.HttpException: This is an invalid script resource request

后端 未结 5 1457
忘掉有多难
忘掉有多难 2021-02-01 10:30

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 (consideri

5条回答
  •  野性不改
    2021-02-01 11:08

    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.

    1. 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.
    2. 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.

提交回复
热议问题