microsoft / vscode-docker

Docker Extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-docker
Other
1.18k stars 508 forks source link

Ignore commented <UserSecretsId> tag in .csproj #4268

Closed FiftyNine closed 2 months ago

FiftyNine commented 3 months ago

Currently the extension employs this simple regex /UserSecretsId/i to detect if .NET project file uses values stored in Secret Manager. If this string is found in the project file, than the "docker-run" task generates a command that attempts to mount the secrets folder onto the container. If this folder does not exist than the command fails. Problem is that this regex doesn't consider that the tag may be commented out. I propose removing all commented sections from the .csproj contents before testing UserSecretsId regex against it.

bwateratmsft commented 1 month ago

This should be released now in version Docker extension version 1.29.1.