Skip to content

Use Windows UI to prompt for package source credentials in VS - #7706

Merged
zivkan merged 2 commits into
devfrom
dev-zivkan-fix-source-credential-prompt
Sep 17, 2026
Merged

zivkan merged 2 commits into
devfrom
dev-zivkan-fix-source-credential-prompt

Conversation

@zivkan

@zivkan zivkan commented Sep 14, 2026

Copy link
Copy Markdown
Member

Bug

Fixes: NuGet/Home#14791

Description

Neither I, nor copilot, could find a generic "ask for credentials" API in the VS SDK, so P/Invoke Windows' CredUIPromptForCredentialsW API to prompt for credentials, with messages that we control. The docs on the api say that it's available from Windows XP and Windows Server 2003, while Visual Studio 2026's system requirements docs lists Windows 11 and Windows Server 2019 as the oldest versions, so the API should always be available. Given the dialog windows look the same, it's probable that VS's "get proxy creds" API uses it as well.

image
comparison to existing prompt image

PR Checklist

  • Meaningful title, helpful description and a linked NuGet/Home issue
  • Added tests
  • Link to an issue or pull request to update docs if this PR changes settings, environment variables, new feature, etc. N/A

@zivkan
zivkan requested a review from a team as a code owner September 14, 2026 21:56
@zivkan
zivkan requested a review from jeffkl September 16, 2026 06:12
@zivkan
zivkan merged commit bb52356 into dev Sep 17, 2026
18 checks passed
@zivkan
zivkan deleted the dev-zivkan-fix-source-credential-prompt branch September 17, 2026 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NuGet should not ask for proxy credentials when it wants package source credentials

3 participants