Skip to content

Conversation

SatishKalluri
Copy link
Contributor

…les for dotnet #4581

Fix for - Running func new in an empty directory creates incorrect files

resolves #4581

Pull request checklist

  • [ x] My changes do not require documentation changes
    • Otherwise: Documentation issue linked to PR
  • [ x] My changes do not need to be backported to a previous version
    • Otherwise: Backport tracked by issue/PR #issue_or_pr
  • [ x] My changes should not be added to the release notes for the next release
    • Otherwise: I've added my notes to release_notes.md
  • [ x] I have added all required tests (Unit tests, E2E tests)

Additional information

Additional PR information

@SatishKalluri SatishKalluri requested a review from a team as a code owner September 30, 2025 08:24
// Ensure that the _templates are loaded before we proceed
_templates = await _templatesManager.Templates;

// Ensure that the worker runtime and language are set.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only changes in this PR is a comment, was there meant to be something else?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes Lilian, after reverting only this comment is the addition

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I don't understand how this makes sense, what does a comment have to do with the original issue?

In the issue, you mention:

@liliankasem have checked the issue and debugged, found out that little line order change in the code to check the language and runtime been selected before creating any templates if we run 'func new' without 'func init' will resolve this issue by changing the line order of 116 prior to 114 - https://github.com/Azure/azure-functions-core-tools/blob/main/src/Cli/func/Actions/LocalActions/CreateFunctionAction.cs

This makes sense so I was expecting this PR to swap around these checks

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @liliankasem ... the fix which was mentioned throwing build error for some test cases, so we are fixing it and will remove the unnecessary comments in the next fix shortly

@liliankasem
Copy link
Member

Hi @SatishKalluri - I have a prosposed solution for this issue: #4672

Do you mind working of that branch instead to ensure edge cases are accounted for and tests are write where needed?

@SatishKalluri
Copy link
Contributor Author

Hi @liliankasem, Sure
Wanted to confirm, can you please let me know if I can close my PR and continue working on your branch

@liliankasem
Copy link
Member

Hi @liliankasem, Sure Wanted to confirm, can you please let me know if I can close my PR and continue working on your branch

Yes, please do that

@liliankasem liliankasem closed this Oct 9, 2025
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.

Running func new in an empty directory creates incorrect files for dotnet

2 participants