【发布时间】:2022-12-27 21:41:51
【问题描述】:
I have a class library created with dot net core 3.1. There are two files which I am using for logging and reading appsetting.json file. For this I am using two custom class files respectively for logging and reading appesttings.json file. Here is sample code for same.
1)Logging (File 1:CustomLogger.cs)
2)Reading appsetting.json (File 2: ConfigHelper.cs)
Now I am consuming my class library by adding project reference in another separate console application.
When I run my console application, I am getting an exception in GetCurrentSettings method where I am not able to reach to appsetting.json file. Instead it is trying to find that file in current console application of bin folder.
So How could I read appsetting.json values from base project.
【问题讨论】:
标签: c# class-library