Sim*_*gré 16 c# visual-studio-2010 asp.net-4.0
我们偶尔会发现这个错误.有谁知道它会是什么?
我们的错误记录提供的URL为此错误获取此奇怪的URL:
错误是:
Error : This is an invalid script resource request.
我们也得到了栈跟踪:
System.Web.HttpException:这是一个无效的脚本资源请求.System.Web上的System.Web.Handlers.ScriptResourceHandler.ProcessRequest(HttpContext上下文)中的System.Web.Handlers.ScriptResourceHandler.Throw404()处于System.Web的System.Web.Handlers.ScriptResourceHandler.System.Web.IHttpHandler.ProcessRequest(HttpContext context) System.Web.HttpApplication.ExecuteStep中的.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()(IExecutionStep step,Boolean&completedSynchronously)
会是什么呢?它怎么解决?
The*_*thy 30
我经常得到这个错误,做了一些研究我发现了以下内容.
如果您有Web场,则可能未设置计算机密钥,如果是这种情况,您可以通过为Web场中的每个服务器设置计算机密钥来解决问题.如果机器密钥在回发之间发生变化(有时可能发生),也会发生错误.我相信如果你没有使用网络农场,这种情况很常见.如果您有一个Web场,这是最可能的原因.
http://msdn.microsoft.com/en-us/library/ms998288.aspx
它可能是由蜘蛛引起的,robots.txt文件可能会有所帮助,但前提是它们表现良好.一个更好的解决方案可能是记录导致错误的客户端的IP地址,如果它们看起来像蜘蛛,禁止IP地址,但要注意不要阻止合法用户.
示例robots.txt
User-agent: *
Disallow: /WebSite/ScriptResource.axd
Disallow: /WebSite/WebResource.axd
Run Code Online (Sandbox Code Playgroud)
3.用户会话超时也会导致此错误.
希望其中一个答案有所帮助
来源
1)System.Web.HttpException:这是一个无效的脚本资源请求
2)http://www.mojoportal.com/Forums/Thread.aspx?pageid=5&mid=34&ItemID=2&thread=4501&pagenumber=1
3)http:/ /www.thestudentroom.co.uk/showthread.php?t=1258531#post25063929