Skip to content
This repository was archived by the owner on Jul 20, 2026. It is now read-only.

Commit 263672f

Browse files
authored
Ignore commented <UserSecretsId> tag in .csproj (#4268)
1 parent b100543 commit 263672f

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/tasks/netcore/NetCoreTaskHelper.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,9 @@ export class NetCoreTaskHelper implements TaskHelper {
195195

196196
private async inferUserSecrets(helperOptions: NetCoreTaskOptions): Promise<boolean> {
197197
const contents = await fse.readFile(helperOptions.appProject);
198-
return UserSecretsRegex.test(contents.toString());
198+
// Remove comments so we don't match a commented tag
199+
const noComments = contents.toString().replace(/<!--.*?-->/gs, "");
200+
return UserSecretsRegex.test(noComments);
199201
}
200202

201203
private async inferVolumes(folder: WorkspaceFolder, runOptions: DockerRunOptions, helperOptions: NetCoreTaskOptions, ssl: boolean, userSecrets: boolean): Promise<DockerContainerVolume[]> {

0 commit comments

Comments
 (0)