gpt4 book ai didi

visual-studio - 无法从Visual Studio 2017连接到Docker上的远程调试器

转载 作者:行者123 更新时间:2023-12-02 18:27:36 28 4
gpt4 key购买 nike

我有一个Docker Composer,看起来像:

    version: '2.4'

services:

sql:
image: sitecore-xm1-sxa-1.9.0-sqldev:9.2.0-windowsservercore-${windows_version}
volumes:
- .\build\data\sql:C:\Data
mem_limit: 2GB
ports:
- "44010:1433"

cd:
image: sitecore-xm1-sxa-1.9.0-cd:9.2.0-windowsservercore-${windows_version}
volumes:
- .\build\data\cd:C:\inetpub\sc\App_Data\logs
- .\build\Website:C:\src
- d:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\Remote Debugger:C:\remote_debugger:ro
- .\src:c:\unicorn\
- .\docker-specific-files:c:\docker-specific-files
ports:
- "44002:80"
expose:
- "4023"
- "4022"
- "4021"
- "4020"
links:
- sql
entrypoint: cmd /c "start /B powershell C:/sitecore/scripts/Watch-Directory.ps1 C:/src C:\inetpub\sc & powershell C:/sitecore/scripts/Watch-Directory.ps1 C:/docker-specific-files C:\inetpub\sc -ExcludeFiles @('Web.config','ConnectionStrings.config') & C:\\remote_debugger\\x64\\msvsmon.exe /noauth /anyuser /silent /nostatus /noclrwarn /nosecuritywarn /nofirewallwarn /nowowwarn /timeout:2147483646"

cm:
image: registry.valtech.dk/sitecore-xm1-sxa-1.9.0-cm:9.2.0-windowsservercore-${windows_version}
volumes:
- .\build\data\cm:C:\inetpub\sc\App_Data\logs
- .\build\Website:C:\src
- .\docker-specific-files:c:\docker-specific-files
- .\src:c:\unicorn\
- d:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\Remote Debugger:C:\remote_debugger:ro
ports:
- "44001:80"
expose:
- "4023"
- "4022"
- "4021"
- "4020"
links:
- sql
entrypoint: cmd /c "start /B powershell C:/sitecore/scripts/Watch-Directory.ps1 C:/src C:\inetpub\sc & powershell C:/sitecore/scripts/Watch-Directory.ps1 C:/docker-specific-files C:\inetpub\sc -ExcludeFiles @('Web.config','ConnectionStrings.config') & C:\\remote_debugger\\x64\\msvsmon.exe /noauth /anyuser /silent /nostatus /noclrwarn /nosecuritywarn /nofirewallwarn /nowowwarn /timeout:2147483646"

Docker工作正常,我可以连接到它,并查看远程调试器是否正在运行。

但是VS找不到 here文章中描述的任何远程调试器

我缺少什么,可能是个问题?

最佳答案

由于您将远程调试器用于Visual Studio 2017,因此必须公开端口“4022”(您可以在MS docs: Remote Debugger Port Assignments上找到更多信息)。
根据您在问题中提到的文章,您必须映射如下端口:

cd:
...
ports:
- "44002:80"
- "4022:4022"
...

而且您可以从Docker Compose文件中删除“暴露”部分,因为不需要进行此类端口暴露。

关于visual-studio - 无法从Visual Studio 2017连接到Docker上的远程调试器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57823368/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com