1

I found several posts on how to debug Customer Sample Solution or the new plugin we created.

Could someone suggest me the step-by-step guide to debug the default (original) plugin in Sitecore Commerce, such as those from Sitecore.Commerce.Plugin.Pricing? For example: Plugin.Pricing.ResolvePriceCardsByBookBlock in IResolveActivePriceSnapshotByTagsPipeline

I am not sure if this can be achieved by using .NET Reflector. I have tested using "enable debugging" feature from VS Extension of .Net Reflector on Sitecore.Commerce.Plugin.Pricing assembly keeps causing the VS to restart when it reaches 61% of the process of enabling the debugging for that assembly.

The version of Sitecore Experience Commerce is 9 Initial Release.

The version of .NET reflector in VS 2017 Professional is .Net Reflector Pro 10.

1
  • What's the reason you want to debug their code? Is it to check your input data?
    – PaoloTa
    Commented May 4, 2018 at 10:20

2 Answers 2

2

I don't have experience debugging them with reflector. However, I have been able to successfully debug them with dotpeek as a symbol server: https://www.jetbrains.com/help/decompiler/Using_product_as_a_Symbol_Server.html

However, don't expect to much, the code is optimized by the compiler and debugging it this way is quite hard to setup. In my experience you get quicker results by reasoning about the executing by analyzing the code and log files. Hope this helps.

2
  • Hi Jonne, thanks for your suggestion. How do you load the assembly of the Commerce Engine (e.g. Sitecore.Commerce.Plugin.Pricing)? What I have done: 1. I generated the pdb and run symbol server for Sitecore.Kernel (Sitecore XP) and Sitecore.Commerce.Plugin.Pricing (Commerce Engine) 2. My Visual Studio's Tools > Options > Debugging has pointed to the generated PDBs 3. Attached process to w3wp of Sitecore site, I could see several assemblies are loaded in Modules window 4. I stop debugging and I attached to w3wp of Commerce Engine, no assemblies of Commerce Engine loaded in Modules window
    – xdrnc
    Commented May 4, 2018 at 9:19
  • 3
    Don't attach to the w3wp process, but to the process of the engine self. Probably Sitecore.Commerce.Engine.exe?
    – Jonne Kats
    Commented May 7, 2018 at 6:59
0

Below are different ways to debug Sitecore Commerce Engine

  • Debug Sitecore Commerce Engine solution by attaching process in a same way as we do for Sitecore. Attach Sitecore.Commerce.Engine process instead of w3wp.

Or

  • Stop Commerce Authoring in IIS and Run Sitecore Commerce Solution from Visual Studio after making below changes in Sitecore Commerce Engine project:
  1. Set Profile to Engine
  2. Set App Url to Commerce Authoring url

You can find more ways to debug sitecore commerce here. https://sitecore-commerce.blogspot.com/2021/02/simplest-way-to-debugging-sitecore.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.