简体   繁体   中英

any way to check profiler mode in C# dynamics 365?

In plugin, I want to trace Fetch-XML Query when it is in profiling mode only.

Like we check for debug mode:

#if DEBUG
Console.WriteLine("Debug version");
#endif

The official way to do this is to use the Tracing Service in your plug-in, which writes to the Plugin Trace Log. Normally, you'd only want the trace written to the log when there is an exception. But if you are debugging, you can also configure Dynamics to write all trace logs even for successful plugin executions. Just be sure to use this temporarily, as it will affect performance of all plugins that use tracing.

Here is a good resource that explains how to configure the Plugin Trace Log and use the Tracing Service: https://www.powerobjects.com/2016/07/05/debugging-your-plug-ins-with-the-plug-in-trace-log/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM