If you run func host start in a directory outside of the project, it exits with the error: Unable to find project root.. This is good behavior.
However, if you run func host start in a function subdirectory (e.g. HttpTrigger from the examples), then it will create a new host.json file and start. This is inconsistent behavior. A preferred behavior would be to exit similar to if it was outside of the directory.
May i also suggest amending the original error message to:
Unable to find project root.
Expecting to find one of host.json, local.settings.json in project root.
Make sure you're running from your function app's root directory.
Added last line.
personally I'd appreciate a way to run func host start --content <path to my function's root dir> so I don't have to cd to the dir before running func
I agree with @brandonh-msft . Not having this feature makes it difficult to work with functions projects in VS Code when working in a large repo. For example, we have /dotnet/src/FunctionsApp, but VS Code needs to be open at /. This means we can't utilise tasks.json to run the functions app and speed up development
Having a feature like @brandonh-msft mentioned would be much appreciated. Any update on if/when we could expect something like that?
Most helpful comment
personally I'd appreciate a way to run
func host start --content <path to my function's root dir>so I don't have tocdto the dir before runningfunc