Fix C# .NET 10 project creation failing with invalid CLI args#4992
Draft
Copilot wants to merge 6 commits into
Draft
Fix C# .NET 10 project creation failing with invalid CLI args#4992Copilot wants to merge 6 commits into
Copilot wants to merge 6 commits into
Conversation
Agent-Logs-Url: https://github.com/microsoft/vscode-azurefunctions/sessions/560053a7-61b7-40b2-8a78-305fd863274d Co-authored-by: alexweininger <12476526+alexweininger@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix invalid CLI arguments for C# Azure Functions project creation
Fix C# .NET 10 project creation failing with invalid CLI args
Apr 22, 2026
Member
|
@copilot resolve the merge conflicts in this pull request |
…ents-for-csharp-functions # Conflicts: # src/commands/addBinding/settingSteps/StringPromptStep.ts Co-authored-by: nturinski <5290572+nturinski@users.noreply.github.com>
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes project/function creation failures on .NET 10 caused by invalid CLI arguments being sent to
dotnet new(--namespaceand--FunctionsHttpPort "undefined").Root causes
--FunctionsHttpPort "undefined"—StringPromptStep.getDefaultValue()calledString(this._setting.defaultValue)even whendefaultValuewasundefined, producing the literal string"undefined". This pre-filled the prompt and was submitted verbatim.--namespace "Company.Function"—DotnetFunctionCreateStepalways added--namespacetodotnet newargs, but newer .NET templates (e.g. the .NET 10 Azure Functions function template) don't declarenamespaceas a valid parameter, so the CLI rejects it.executeDotnetTemplateCommand(value !== undefined && value !== '') allowednulland stringified‑nullish values ("undefined","null") through to the CLI.Checklist
namespaceparameter (supportsNamespaceflag onIFunctionTemplate, set inparseDotnetTemplates.ts)--namespaceinDotnetFunctionCreateStepontemplate.supportsNamespace && context.namespace; also skipnullvalues when iteratinguserPromptedSettingsDotnetNamespaceStepwhen the template reportssupportsNamespace === falseStringPromptStep.getDefaultValueto returnundefinedwhen the template has nodefaultValue, instead of the literal string"undefined"executeDotnetTemplateCommand.tsto excludenulland literal"undefined"/"null"stringsorigin/main(overlapping fix inStringPromptStep.tsfrom Fix SignalRTrigger C# template showing "null" as default Hub Name #4993)tsc --noEmitandeslintpass clean