我正在尝试调试实体框架查询。但是,如果查询太大,则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查询被截断?
发布评论