Azure / Azure/azure-functions-core-tools

publish doesn't handle linked refs to host.json / local.settings.json

Open
#676 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
1.5k
Forks
498
Avg merge
4d 20h
Merged PRs (30d)
14

Description

I've got a parent dir with two functions in subdirectories.

Function A contains the host.json and local.settings.json files
Function B - via Visual Studio - has these files as *links* referenced in the csproj (eg ../functionA/host.json).

`publish` doesn't respect this. It fails simply because the files aren't in the directory, instead of actually *doing* the build letting the build process link them appropriately and copy them to the output location. Instead I get
~~~
Unable to find project root. Expecting to find one of host.json, local.settings.json in project root.
~~~

for more detail here's my directory structure:
~~~
Directory: C:\Users\...\MyFunctions\MyFunction.v1

Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 8/29/2018 3:11 PM 952 MyFunction.v1.csproj
-a---- 8/29/2018 10:49 AM 394 MyFunction.v1.csproj.user

Directory: C:\Users\...\MyFunctions\MyFunction.v2

Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 8/29/2018 3:11 PM 375 host.json
-a---- 8/30/2018 11:02 AM 946 local.settings.json
-a---- 8/29/2018 2:58 PM 10991 Sample.cs
-a---- 8/29/2018 10:01 AM 904 MyFunction.v2.csproj
-a---- 8/29/2018 3:03 PM 398 MyFunction.v2.csproj.user
~~~

and MyFunction.v1.csproj has this in it:
```xml


PreserveNewest


PreserveNewest

```

This works perfectly in Visual Studio, but nowhere else.

Contributor guide

Open the contributing guide

Research direction

Start with the publish command and the project-root check that expects host.json or local.settings.json in the project directory. Reproduce the linked-file layout from the issue using the MyFunction.v1.csproj entries, then verify that publish lets the build resolve the links and places both files in the output location.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.