Sunday, June 12, 2022

Configure Remote debugger Sitecore 10.2 docker containers

In Sitecore 10.2 and docker containers Code debug is the best thing to understand existing code and write the new code efficiently. I have installed and configure the Sitecore 10.2 on Docker containers, not able to debug the code. I have followed below steps 

1) Make sure Build_Configuration present and add 

REMOTEDEBUGGER_PATH=C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\Remote Debugger\x64 



2) Add below lines to your docker-compose.override.yml file

 - ${REMOTEDEBUGGER_PATH}:C:\remote_debugger:ro
    # entrypoint: powershell -Command "& C:\tools\entrypoints\iis\Development.ps1"

    entrypoint: powershell -Command "& Write-Host 'Starting Debugger Service...'; & Start-Process -FilePath 'C:\remote_debugger\msvsmon.exe' -ArgumentList '/nostatus', '/silent', '/noauth', '/anyuser', '/nosecuritywarn', '/wow64port 4026'; & C:\tools\entrypoints\iis\Development.ps1"



3) Run Below commands

   docker compose down
   docker-compose up -d --build
   docker-compose up -d

4) Once your Sitecore instance up check msvsmon running
Open Powershell as administartor mode and run below commands


PS> Docker exec -it (Your CM container name) powershell
PS> Get-Process



5) Open your Sitecore instance/Page trying to debug in Chrome.

6) Open your solution in Visual Studio and then cotainers window(View-->Other Windows-->Containers) and add the debug points 
7) Right click on the CM container on Container window-->Attach Process-->Check Show all processors-->Search w3wp and select-->Attach

8) Some Times you have to restart your IIS. Run Below command on Power Shell to Restart IIS on your docker instance. 

PS> Docker exec -it sitecore-xp0_cm_1 powershell
PS> Get-Process
PS> iisreset /stop if traffic container is unhealthy





   



No comments:

Post a Comment