Skip to content

deploy multi project - appsettings.json not found #192

@SHackauf

Description

@SHackauf

I changed my .Net google cloud function to a multi-project deployment. The function works on the server but I found out, that the appsetting.json is not more found from the framework.

My source folders look like the following

appsettingsScreenshot

My analysis showed me, that the appsettings.json file is deployed on the server. The problem is, that the framework searches the appsettings.json file in the workspace (Environment.CurrentDirectory) folder and not in the folder of the main project where for example Visual Studio searches the file.

When I deploy the config file from the root folder and not from the main project folder then the framework finds the config file.

appsettingsScreenshotWorks

Would it be possible that the framework searches the config file in the root and in the main project folder? Then the deployment would be much easier because the cloud functions would run like Visual Studio.

Sure I can add the real position of the configuration file inside ConfigureAppConfiguration via configuration.AddJsonFile. But then my configuration file is behind the environment properties and I overwrite them.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions