Azure 表存储异常,没有可用的堆栈跟踪
我收到 System.Data.Services.Client.DataServiceClientException 类型的错误:
MESSAGE:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<code>EntityAlreadyExists</code>
<message xml:lang="en-US">The specified entity already exists.
RequestId:f1c45274-f149-463e-9815-f9ab9bb075f9
Time:2011-10-05T17:20:32.1930748Z</message>
</error>
STACKTRACE:
at System.Data.Services.Client.DataServiceContext.SaveResult.<HandleBatchResponse>d__1e.MoveNext()
我的问题是我无法判断我自己的代码的哪一部分使表存储保存并导致错误。
有谁知道如何使用我自己的代码获得更好的堆栈跟踪?
I'm getting en error of type System.Data.Services.Client.DataServiceClientException:
MESSAGE:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<code>EntityAlreadyExists</code>
<message xml:lang="en-US">The specified entity already exists.
RequestId:f1c45274-f149-463e-9815-f9ab9bb075f9
Time:2011-10-05T17:20:32.1930748Z</message>
</error>
STACKTRACE:
at System.Data.Services.Client.DataServiceContext.SaveResult.<HandleBatchResponse>d__1e.MoveNext()
My problem is that I cant tell what part of my own code is making the table storage save and causing the error.
Does anyone know how I can get a better stacktrace with some of my own code in it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有关如何设置 Azure 诊断的完整详细信息,请参见:http://msdn.microsoft .com/en-us/library/ff966484.aspx。
概括而言,您需要使用 Azure 跟踪侦听器配置应用程序,并更改 Web 角色/辅助角色启动代码以将这些消息复制到表存储。该链接提供了样板代码。
完成此操作后,您应该会发现任何未处理的异常,或者实际上写入 System.Diagnostics.Trace 的任何内容,都将出现在您的 Azure 表存储日志中。
为了读取这些日志,我使用 Cerebrata AzureDiagnosticsManager。还有其他工具可以做到这一点,包括(如果你真的坚持的话!)Visual Studio 本身。
Full details on how to set up Azure diagnostics are here: http://msdn.microsoft.com/en-us/library/ff966484.aspx.
In outline, you'll need to configure your application with an Azure trace listener and change your Web role / worker role startup code to copy these messages to table storage. The link gives the boilerplate code.
Once you've done that you should find that any unhandled exception, or indeed anything written out to
System.Diagnostics.Trace
, will appear in your Azure table storage logs.To read these logs, I use the Cerebrata AzureDiagnosticsManager. There are other tools out there that will do this, including (if you really insist!) Visual Studio itself.