Azure的表的存储异常信息 [英] Azure Table Storage Exception Information

查看:124
本文介绍了Azure的表的存储异常信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

查找调试的Azure表存储非常令人沮丧。直到我了解各种限制,试图找到令人难以置信的信息DataServiceQueryException的事业InvalidInput的code是困难的,至少可以说。

Finding debugging Azure table storage incredibly frustrating. Until I learn about the various limitations, trying to find the cause of incredibly informative DataServiceQueryException with a code of InvalidInput is difficult to say the least.

在很多网上淘,后在的http://blogs.msdn.com/b/partlycloudy/archive/2009/12/16/development-storage-logging.aspx说明如何启用日志记录。这种填充用得多,非常有用的信息的错误日志文件。这可能不是一个好主意,离开这个登录永久,每次我有一个问题是不理想的情况时检查该文件。

After much scouring the web, the post at http://blogs.msdn.com/b/partlycloudy/archive/2009/12/16/development-storage-logging.aspx shows how to turn on logging. This populates the error log file with much more, very useful information. It is probably not a good idea to leave this logging on permanently, and inspecting this file every time I have a problem is not an ideal situation.

有关于使用小提琴手来看看实际的请求和响应很多帖子,但我无法得到这个工作正常。我已经配置了连接字符串通过提琴手代理连接(我不得不手动ipv4.fiddler主机名添加到hosts文件,否则将不解决 - 这是提琴手应该自动完成)。我可以看到用于部署的连接,但没有任何疑问的连接。我试着跑提琴手以管理员身份,但仍得到相同的结果。

There are many posts about using Fiddler to look at the actual requests and responses, but I'm unable to get this working properly. I've configured the connection string to connect through the Fiddler proxy (I had to manually add the ipv4.fiddler host name to the hosts file, otherwise it wouldn't resolve - something Fiddler should do automatically). I can see the connections for deployment, but not connections for any queries. I've tried running Fiddler as administrator, but still get the same results.

这是为什么这么难?我缺少的东西吗?是否有返回在错误日志文件中记录异常的信息,而不是垃圾InvalidInput异常消息的选项?任何想法,为什么提琴手是不是在玩游戏?

Why is this so hard? Am I missing something? Is there an option to return the exception information that is logged in the error log file, rather than the rubbish InvalidInput exception messages? Any ideas why Fiddler is not playing the game?

推荐答案

通常情况下,你会如果你正在尝试使用未在服务支持的操作,得到无效的输入错误消息。请记住,全套LINQ操作(排序,最小值,最大值等)不提供服务(虽然,他们可以在本地计算)。在解决此的第一步应该是看你正在尝试的实际操作。如果您使用的不是。选择()或。凡()以外的东西,有一个很好的机会,它目前不支持。

Typically, you will get the invalid inputs error messages if you are trying to use an operation that is not supported at the service. Keep in mind that the full set of LINQ operations (sorting, min, max, etc.) are not available at the service (though, they can be computed locally). Your first step in troubleshooting this should be to look at the actual operations your are trying. If you are using something other than .Select() or .Where(), there is a good chance it is not currently supported.

修改:当我写到这,我遇到了一个类似的错误。因为我已经知道哪些操作的支持,我想我会告诉你的code口用于解决:

Edit: As soon as I wrote this, I ran into a similar error. Since I already know which operations are supported, I thought I would show you the code I used to troubleshoot:

void Main()
{
    var acct = CloudStorageAccount.DevelopmentStorageAccount;

    var client = acct.CreateCloudTableClient();
    var ctx = client.GetDataServiceContext();
    ctx.IgnoreMissingProperties = true;

    var table = "tl36f6e92d94954f168ade0be6a547c0ce";

    //build query
    var q = ctx.CreateQuery<Foo>(table)
        .Where(e => e.RowKey.CompareTo(2) < 0) //this query fails
        .Take(10);

    //Dump URI to inspect
    ((DataServiceQuery)q).RequestUri.Dump();

    //dump results
    q.Dump();
}


[System.Data.Services.Common.DataServiceKey("PartitionKey", "RowKey")]
class Foo
{
    public string PartitionKey { get; set; }
    public string RowKey { get; set; }
    public string Whatever { get; set; }
}

我(曾经最伟大的工具)下降到这一LINQPad,只是看了看URI。很明显,我正在期待一个字符串和比较正在比较为整数。我当然是简化了实际的查询,但我的观点立场。我使用这个工具所有的时间到我的查询第一个模型,并检查什么是真正发生的事情。

I dropped this into LINQPad (greatest tool ever) and just looked at the URI. It became clear that the comparison I was making was expecting a string and was being compared as an integer. I have of course simplified the actual query, but my point stands. I use this tool all the time to model my queries first and inspect what is actually happening.

这篇关于Azure的表的存储异常信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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