WebResource.axd的错误 - "这是一个无效webresource请求"。 [英] WebResource.axd error - "This is an invalid webresource request."

查看:965
本文介绍了WebResource.axd的错误 - "这是一个无效webresource请求"。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个已经更新到面向.NET 4.0框架的大型.NET 2的Web应用程序。由于更新,我看到下面的错误在我的日志中经常重复的:

  

这是一个无效的webresource   请求。

请求的资源是〜/ WebResource.axd的 据我所知道的,该请求看起来很好的,有一个很长的查询字符串的钥匙(钥匙的ð T ),并为那些键的值。

的机制来生成请求WebResource.axd的框架版本之间改变了吗?有没有人有关于如何去调试这个问题的任何建议?

编辑: 我找到了一种方法,以解密网络资源请求的查询字符串(code以下)。所请求的资源是 pCSSFriendly | CSSFriendly.CSS.Menu.css 看起来像一个问题与寻址的应用程序所使用的资源CSSFriendly.MenuAdapter。这领先的P看起来可能是问题。

 私人字符串DecryptWebResource(字符串urlEn codedData)
{
    字节[]的EncryptedData = HttpServerUtility.UrlTokenDe code(urlEn codedData);
    键入machineKeySection = typeof运算(MachineKeySection);
    键入[] paramTypes =新类型[] {typeof运算(布尔)的typeof(字节[])的typeof(字节[])的typeof(INT)的typeof(INT)};
    System.Reflection.MethodInfo encryptOrDecryptData = machineKeySection.GetMethod(EncryptOrDecryptData,System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic,空,paramTypes,NULL);

    尝试
    {
        byte []的decryptedData =(字节[])encryptOrDecryptData.Invoke(空,新的对象[] {假,的EncryptedData,NULL,0,encryptedData.Length});
        字符串解密= Encoding.UTF8.GetString(decryptedData);
        返回解密;
    }
    赶上(System.Reflection.TargetInvocationException)
    {
    }

    返回的String.Empty;
}
 

解决方案
  
    

的机制来生成请求WebResource.axd的框架版本之间改变了吗?

  

显然应用安全更新(当然改变框架主版本)可改变涉及的WebResource.axd以这样一种方式,以使该误差在客户端 - 服务器交互。我们应用补丁后看到这个错误,原因似乎是客户端缓存 HTTP://forums.asp .NET / T / 1609380.aspx - 错误走了30天左右。

I have a large .NET 2 web application that has been updated to target the .NET 4.0 framework. Since the update, I am seeing the following error recurring regularly in my logs:

This is an invalid webresource request.

The resource requested is "~/WebResource.axd" As far as I can tell, the request looks fine in that there's a long querystring with keys (keys are d, t) and values for those keys.

Has the mechanism for generating requests to WebResource.axd changed between framework versions? Does anyone have any advice about how to go about debugging this issue?

Edit: I found a way to decrypt the web resource request querystring (code follows). The requested resource is pCSSFriendly|CSSFriendly.CSS.Menu.css which looks like an issue with addressing the CSSFriendly.MenuAdapter resource which is used by the application. That leading "p" looks like it could be the problem.

private string DecryptWebResource(string urlEncodedData)
{
    byte[] encryptedData = HttpServerUtility.UrlTokenDecode(urlEncodedData);
    Type machineKeySection = typeof(MachineKeySection);
    Type[] paramTypes = new Type[] { typeof(bool), typeof(byte[]), typeof(byte[]), typeof(int), typeof(int) };
    System.Reflection.MethodInfo encryptOrDecryptData = machineKeySection.GetMethod("EncryptOrDecryptData", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic, null, paramTypes, null);

    try
    {
        byte[] decryptedData = (byte[])encryptOrDecryptData.Invoke(null, new object[] { false, encryptedData, null, 0, encryptedData.Length });
        string decrypted = Encoding.UTF8.GetString(decryptedData);
        return decrypted;
    }
    catch (System.Reflection.TargetInvocationException)
    {
    }

    return String.Empty;
}   

解决方案

Has the mechanism for generating requests to WebResource.axd changed between framework versions?

Apparently applying security updates (and certainly changing framework major versions) can alter the client-server interaction involving WebResource.axd in such a way as to cause this error. We saw this error after applying patches and the cause seems to be client side caching http://forums.asp.net/t/1609380.aspx - the errors went away after 30 days or so.

这篇关于WebResource.axd的错误 - "这是一个无效webresource请求"。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆