Generate INI files

Run the PS command SDAGenerateINIFileForDebug to generate the ini files.
Source url

Environment variables

Set COMPlus_ZapDisable=1 to avoid loading the pre-compiled to native code.
Source url

Set COMPlus_JITMinOpts=1
Source url

Visual Studio settings

Check/Uncheck below debug optons in Visual Studio.

  • Suppress JIT optimization on module load (Managed only)
  • Enable Just My Code
  • Supress JIT optimization on module load
  • Use Managed Compatability Mode – This option helps in viewing the COM components in debug mode
  • Use Native Compatability Mode – This option helps in viewing the COM components in debug mode.

Visual Studio Debug Tips

  • After attaching to the VS code modify the Web.config or global.asmx file.
  • This will reloaded all the binaries with no optmizations.

The following will invoke an app domain restart

  • Modification to web.config or Global.asax
  • Change to the contents of the application’s bin directory
  • Change to the physical path of the virtual directory
  • Deletion of the subdirectory

Viewing byte array in debug window

  • Use below expression to convert the bytes into string
//buffer is byte array
System.Text.Encoding.UTF8.GetString(buffer, 0, buffer.Length)

Reverse Engineer tools

.Net Reflector

Used for Visual Studio debugging

dnSpy

Used for editing binaries and debugging
Source link

ILSpy

Core framework used for debugging
Source link

SDx logs

Desktop Client tracing

  • Update \SmartPlant\Foundation\SPFDesktopClient\CurrentVersion\tracesettings.config with below for getting complete trace
<categorySources>
    <!-- Possible All, Critical, Error, Warning, Information, Verbose, Off -->
    <add switchValue="All" name="General">
      <listeners>
        <add name="Rolling TraceListener"/>
      </listeners>
    </add>
    <add switchValue="All" name="Performance">
      <listeners>
        <add name="Rolling TraceListener"/>
      </listeners>
    </add>
    <add switchValue="All" name="WebRequest">
      <listeners>
        <add name="Rolling TraceListener"/>
      </listeners>
    </add>
    <add switchValue="All" name="Schema">
      <listeners>
        <add name="Rolling TraceListener"/>
      </listeners>
    </add>
    <add switchValue="All" name="DatabaseAccess">
      <listeners>
        <add name="Rolling TraceListener"/>
      </listeners>
    </add>
    <add switchValue="All" name="SQL">
      <listeners>
        <add name="Rolling TraceListener"/>
      </listeners>
    </add>
    <add switchValue="All" name="Core">
      <listeners>
        <add name="Rolling TraceListener"/>
      </listeners>
    </add>
    <add switchValue="All" name="Email">
      <listeners>
        <add name="Rolling TraceListener"/>
      </listeners>
    </add>
    <add switchValue="All" name="Login">
      <listeners>
        <add name="Rolling TraceListener"/>
      </listeners>
    </add>
    <add switchValue="All" name="TEF">
      <listeners>
        <add name="Rolling TraceListener"/>
      </listeners>
    </add>
    <add switchValue="All" name="RemoteServices">
      <listeners>
        <add name="Rolling TraceListener"/>
      </listeners>
    </add>
    <add switchValue="All" name="DocMgmt">
      <listeners>
        <add name="Rolling TraceListener"/>
      </listeners>
    </add>
    <add switchValue="All" name="Loader">
      <listeners>
        <add name="Rolling TraceListener"/>
      </listeners>
    </add>
    <add switchValue="All" name="Scheduler">
      <listeners>
        <add name="Rolling TraceListener"/>
      </listeners>
    </add>
    <add switchValue="All" name="Custom">
      <listeners>
        <add name="Rolling TraceListener"/>
      </listeners>
    </add>
    <add switchValue="All" name="APITrace">
      <listeners>
        <add name="Rolling TraceListener"/>
      </listeners>
    </add>
    <add switchValue="All" name="Metering">
      <listeners>
        <add name="Rolling TraceListener"/>
      </listeners>
    </add>
    <add switchValue="All" name="IHUB">
      <listeners>
        <add name="Rolling TraceListener"/>
      </listeners>
    </add>
    <add switchValue="All" name="Cache">
      <listeners>
        <add name="Rolling TraceListener"/>
      </listeners>
    </add>
  </categorySources>
  • Update \SmartPlant\Foundation\SPFDesktopClient\settings.xml file as below
<configuration>
  <debug level="9" dir="C:\Trace\Clientlogs" />
  <images dir="..\..\Icons" />
  <Exported dir="" />
</configuration>

SPF Web client prettier command

prettier --print-width 80 --no-semi --single-quote --trailing-comma es5 --write *.js