Friday, November 4, 2022

How to configure Remote debugger in Sitecore 10.2 docker containers

 We may face challenges when we debug the code in the docker container the very first time. Follow the below steps to enable the Remote debugger in Sitecore 10.2 docker containers.


1. .env file changes:

Make sure the Build_Configuration value is set to 'debug'

Also, set the path for REMOTEDEBUGGER_PATH.




2. Add the following configuration to the file - docker-compose.override.yml

 - ${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 the below commands

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


4. Open Powershell in administrator mode and run the below commands to see whether the 'msvsmon' process is present or not.


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



5) Hit the page or API in Chrome.

6) Open your solution in Visual Studio and then the containers window(View-->Other Windows-->Containers) and attach 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 the 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


                                                  
                                                     *Happy learning*

No comments:

Post a Comment

How to Create a Public Link Using the Sitecore Content Hub REST API

Creating a public link using the Sitecore Content Hub REST API is a straightforward process that enables you to share content externally whi...