2

I tried the procedure mentioned in the link https://www.youtube.com/watch?v=bboda7Gj5Hc&list=PLLYksLXV8OcG3-fKtMJgDixBFo3kfeCpD&index=21. But the breakpoints does not get hit and plus the code is published in debug mode.

Followed the following steps: Details: Sitecore 10.2 Visual Studio 2022

  • Visual Studio -> Debug -> Attached to process (w3wp.exe)-> added breakpoints
  • Refreshed the hosted site

Is there anything I am missing?

4
  • what code are you trying to debug? if it's a pipeline did you publish the configuration files? Commented Feb 21, 2022 at 13:30
  • 1
    I will suggest if you can check that which mode you are using to publish. It should be debug mode. Also you can refer this link for more details. Visual Studio publish in debug Vs Release mode Commented Feb 21, 2022 at 13:36
  • controller code in Asp.net MVC Commented Feb 21, 2022 at 13:42
  • @SumitBhatia Thank you it worked. Commented Feb 22, 2022 at 8:58

4 Answers 4

0

You can try below things

  1. Check your publish directory path is correct, I mean check in publish directory, time updated on dll's and other files.
  2. Try clearing the Sitecore cache.
0

If your code is in debug mode and the directory path is correct then there can be a chance that due to HTML caching it's not working. Your breakpoint will hit the first time after that will retrieve data from the cache.

Could you please check that HTML caching is enabled on your rendering either on Item or Page level?

  • Go to the respective rendering and in caching section uncheck the caching options:

enter image description here

OR

  • Go to the page and in presentation details check the same options in control properties windows:

enter image description here

0

Please confirm if the breakpoints in the VS code are not hitting or if they are not loading at all.

If in case the breakpoints in the class files are not loading at all then possible reasons can be -

  1. Code is NOT compiled in DEBUG mode. From the Build menu, select Configuration Manager, then select Debug mode.
  2. DLL's is deployed to Sitecore's Webroot Bin directory however generated .PDB file of the project is not deployed to the bin. Hence, ensure the .Dll and .PDB both files are deployed to the correct Sitecore application's bin directory.
  3. You may not be attaching to the correct IIS Worker Process instance (w3wp). Find the correct application instance and attach the visual studio debugger to the application instance that runs using the deployed DLL. 4 Remove .NET Temporary Files to clear IIS Cache. Go to the following directory and delete every folder in there. C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files. Restart Visual Studio, Reset IIS Application pool.
  4. Clear Sitecore Cache

Hope this helps.

Regards, Vidhi

0

Got the resolution to the issue. The publish configuration setting was in Release mode, when changed to debug it worked.

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.