-1

I added custom json file in my .net core web API project and retrieved data from that json file successfully when running it in debug mode. But, problem arise when I run it as a docker container.

Error says "Missing custom.json file in '/app/' folder".

1 Answers1

0

Please modify your .csproj file like below to include your custom.json file.

<ItemGroup>
    <ResolvedFileToPublish Include="azure-functions-host/appsettings.prod.json">
    <RelativePath>azure-functions-host/appsettings.prod.json</RelativePath>
    </ResolvedFileToPublish>
</ItemGroup>

For more details, you can refer below post.

ASP.NET Core: Exclude or include files on publish

Jason
  • 9,555
  • 1
  • 8
  • 18