Skip to content

Enable tracing in XrmToolBox

MscrmTools edited this page Jan 5, 2016 · 1 revision

Since version 1.2015.12.20, XrmToolBox uses new assemblies from CRM 2016 SDK. One of the problem is that failing connection does not give more error than "Unable to log to Dynamics CRM".

To resolve this problem, you can enable tracing on XrmToolBox by creating/updating XrmToolBox.exe.config configuration file located in XrmToolBox folder. The content of the file should be at minimum the following

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
  </startup>
  <system.diagnostics>
    <trace autoflush="true" />
    <sources>
      <source name="Microsoft.Xrm.Tooling.Connector.CrmServiceClient"
              switchName="Microsoft.Xrm.Tooling.Connector.CrmServiceClient"
              switchType="System.Diagnostics.SourceSwitch">
        <listeners>
          <add name="console" type="System.Diagnostics.DefaultTraceListener" />
          <remove name="Default" />
          <add name ="fileListener" />
        </listeners>
      </source>

      <source name="Microsoft.Xrm.Tooling.CrmConnectControl"
              switchName="Microsoft.Xrm.Tooling.CrmConnectControl"
              switchType="System.Diagnostics.SourceSwitch">
        <listeners>
          <add name="console" type="System.Diagnostics.DefaultTraceListener" />
          <remove name="Default" />
          <add name ="fileListener" />
        </listeners>
      </source>
    </sources>
    <switches>
      <!--
            Possible values for switches: Off, Error, Warning, Info, Verbose
                Verbose:    includes Error, Warning, Info, Trace levels
                Info:       includes Error, Warning, Info levels
                Warning:    includes Error, Warning levels
                Error:      includes Error level
        -->
      <add name="Microsoft.Xrm.Tooling.Connector.CrmServiceClient" value="Verbose" />
      <add name="Microsoft.Xrm.Tooling.CrmConnectControl" value="Verbose" />
    </switches>
    <sharedListeners>
      <add name="fileListener" type="System.Diagnostics.TextWriterTraceListener" initializeData="XRMToolingLogs.log" />
    </sharedListeners>
  </system.diagnostics>
</configuration>

The trace file will be located in XrmToolBox folder