Azure / Azure/azure-functions-core-tools

Unclear error message "Can't determine project language from files" during debugging, when there actually are issues with local.settings.json

Open
#3,560 5 comments 3 reactions 1 assignee Claimed by @khkh-ms View on GitHub
Dominant language
C#
Stars
1.5k
Forks
498
Avg merge
4d 20h
Merged PRs (30d)
14

Description

When debugging a .NET 8 Function locally, and there is a syntax mistake in the local.settings.json file,, the 'func host start' and 'Azure Functions core tools throws the same unclear and not so helpful error:

`Can't determine project language from files. Please use one of [--csharp, --javascript, --typescript, --java, --python, --powershell, --custom]`

This is a very unclear error message and after some trial and error I found out it was due to a syntax mistake in my custom config settings in local.settings.json.

How to reproduce:
- create new time triggered (or any other) Function using the VSCode wizard
- extend local.settings.json with the custom setting as found below

```
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "",
"FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated",
"ConfigSettings:ServiceBusQueues": ["my-test-queue"]
}
}
```
- press F5 to see the error
2023_12_24_15_57_30_local settings json_net8function_Visual_Studio_Code

The mistake (now) obviously is in the fact the local.settings.json doesn't support arrays and I should specify it as:
` "ConfigSettings:ServiceBusQueues:0": "my-test-queue"`

Although I suspect there can be many reasons for this error to show up, it would be helpful to have some suggested causes as searching for this error also doesn't give many results.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.