如何避免IntelliTrace事件中的EF查询被截断?

编程入门 行业动态 更新时间:2024-10-24 19:30:16
本文介绍了如何避免IntelliTrace事件中的EF查询被截断?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试调试实体框架查询。但是,如果查询太大,则intelliTrace中显示的查询会被截断(即使我将其复制并粘贴到记事本中,也只会显示查询的一部分)。是否有任何变通办法来获得EF生成的整个查询?

I'm trying to debug an entity framework query. But when the query gets too big, the query showed in the intelliTrace appears truncated (only part of the query is displayed, even if I copy and paste it in a notepad). Is there any workaround to get the entire query generated by EF?

预先感谢。

推荐答案

已经有一段时间了,但是可能会对其他人有所帮助。

It has been some time but it might help others.

看看: C:\Program Files(x86 )\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\IntelliTrace\14.0.0\en\collectionplan.xml

take a look at: C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\IntelliTrace\14.0.0\en\collectionplan.xml

14代表VS 2015 在266行附近,您将看到

14 refers to VS 2015 Around line 266 you will see

<DiagnosticEventSpecification>

进一步查找并找到< DataQueries> 里面有一个:

go a bit furter and locate <DataQueries> Inside those there is a:

<DataQuery index="0" maxSize="4096" type="String" name="Command Text" _locID="dataquery.SqlCommand.ExecuteReader.CommandText" _locAttrData="name" query="_commandText"></DataQuery>

将 maxSize = 4096 更改为满足您需求的东西。

Change the maxSize="4096" to what ever fits your need.

更多推荐

如何避免IntelliTrace事件中的EF查询被截断?

本文发布于:2023-10-17 13:12:45,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1501020.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:事件中   IntelliTrace   EF

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!