provo a fare funzionare il di Visual Studio Remote Debugger in un di Windows contenitore su Windows Server 2016 TP4. Poiché viene eseguito all'interno di un contenitore, non esiste un'interfaccia utente.esecuzione di Visual Studio Remote Debugger in Windows Container (Docker gestito)
provo a fare funzionare il debugger remoto tramite:
.\msvsmon.exe /nostatus /silent /nosecuritywarn /nofirewallwarn /noclrwarn /port 4020
sto eseguendo quanto sopra come utente amministratore (NT AUTHORITY \ system). Funziona bene sul computer host, ma non funziona all'interno del contenitore. Il registro eventi di Windows mostra il seguente evento di errore.
Msvsmon was unable to start a server named "`6D2D071453C5:4020`".
The following error occurred: The parameter is incorrect.
Complete registro eventi:
Get-EventLog -LogName Application -EntryType Error | format-list
Index : 1718
EntryType : Error
InstanceId : 3221226473
Message : The description for Event ID '-1073740823' in Source 'Visual Studio Remote Debugger' cannot be found. The local computer may not have the necessary registry information or message DLL
files to display the message, or you may not have permission to access them. The following information is part of the event:'Msvsmon was unable to start a server named
'6D2D071453C5:4020'. The following error occurred: The parameter is incorrect.
View Msvsmon's help for more information.'
Category : (0)
CategoryNumber : 0
ReplacementStrings : {Msvsmon was unable to start a server named '6D2D071453C5:4020'. The following error occurred: The parameter is incorrect.
View Msvsmon's help for more information.}
Source : Visual Studio Remote Debugger
TimeGenerated : 05.04.2016 9:47:19 AM
TimeWritten : 05.04.2016 9:47:19 AM
UserName : NT AUTHORITY\SYSTEM
ho notato un problema che riguarda l'hostname del contenitore, ma questo può essere risolto:
6D2D071453C5
è l'ID contenitore del mio contenitore di Windows (finestra mobile gestita):
PS C:> docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
6d2d071453c5 d9d15fbca6d7 "cmd /S /C 'C:\\myprg-" 6 days ago Up 3 days derrin
Di solito, in Docker, questo ID contenitore sarà anche il nome host all'interno del contenitore.
Così, quando corro docker inspect 6d2d071453c5
, ottengo questo nell'output:
"Config": {
"Hostname": "6d2d071453c5",
"Domainname": "",
Ma poi, all'interno del contenitore, di tipo I "hostname
" nella riga di comando e ottenere:
PS C:> hostname
test2016
Questo è un bug specifico per Windows Server 2016 Contenitori TP4/Windows al momento. Il nome host non deve essere test2016
(il nome dell'host contenitore, il mio server fisico effettivo Win2016) ma l'id contenitore (6d2d071453c5
). Almeno, questo sarebbe il mio comportamento previsto e questo è anche il caso quando eseguo qualsiasi altro contenitore, ad esempio un contenitore Ubuntu, su Windows che richiede una VM. L'ho appena ricontrollato.
Tuttavia, per aggirare il problema, ho regolare il file host, aggiungendo:
172.16.0.2 6d2d071453c5
ora posso rumore metallico il mio proprio nome host, almeno.
PS C:\Program Files\Microsoft Visual Studio 14.0\Common7\IDE\Remote Debugger\x64> ping 6D2D071453C5
Pinging 6d2d071453c5 [172.16.0.2] with 32 bytes of data:
Reply from 172.16.0.2: bytes=32 time<1ms TTL=128
Reply from 172.16.0.2: bytes=32 time<1ms TTL=128
Tuttavia, il debugger remoto ancora non si avvia, e dice ancora:
Msvsmon was unable to start a server named "`6D2D071453C5:4020`".
The following error occurred: The parameter is incorrect.
non vedo cosa c'è di sbagliato con uno qualsiasi dei parametri, in base al file di aiuto accompagnati che elenca tutti i parametri e le opzioni. Lo stesso comando funziona bene sull'host del contenitore, ma non all'interno del contenitore.
Qualcuno ha ottenuto che il debugger remoto funzionasse all'interno di un container?
Aggiornamento ======= ======
Come suggeriscono di seguito, ho provato il parametro hostname. Non vedo più alcun errore nel registro eventi, ma non vedo nulla che stia ascoltando sulla porta 4020.
Eseguito all'interno del contenitore nella directory C: \ Programmi \ Microsoft Visual Studio 14.0 \ Common7 \ IDE \ Remote Debugger \ x64:
> hostname
WIN-DE6U4068NAF
> ".\msvsmon.exe /nostatus /silent /nosecuritywarn /nofirewallwarn /noclrwarn /port 4020 /hostname WIN-DE6U4068NAF"
.\msvsmon.exe /nostatus /silent /nosecuritywarn /nofirewallwarn /noclrwarn /port 4020 /hostname WIN-DE6U4068NAF
> netstat -ab | find "4020"
>
Aggiunto problema di docker relativo al nome host: https://github.com/docker/docker/issues/21762 –
Il problema dell'hostname sembra essere un problema noto di Container Windows in Server 2016 TP4, vedere https://github.com/docker/docker/temi/21762 # issuecomment-205.904.128. Tuttavia, la mia domanda originale rimane. –
Il problema dell'hostname è stato risolto in Server 2016 TP5, tuttavia, non ha ancora ottenuto il debugger remoto su cui lavorare. –