How to avoid truncated EF query in the IntelliTrace events?

蓝咒 提交于 2019-12-09 13:13:22

问题


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?

Thanks in advance.


回答1:


It has been some time but it might help others.

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 refers to VS 2015 Around line 266 you will see

<DiagnosticEventSpecification>

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>

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




回答2:


In VS 2017, I found the collectionplan.xml in C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\IntelliTrace\en.

Then I needed to restart VS.



来源:https://stackoverflow.com/questions/18134617/how-to-avoid-truncated-ef-query-in-the-intellitrace-events

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!