I have my database related stuff in another project which is a class library. I would like to specify the connection string in my config.json
file. However, I couldnt find out how to read the configuration. Inside the static constructor of my SessionFactory
I call:
var builder = new ConfigurationBuilder()
.AddJsonFile("config.json");
Configuration = builder.Build();
However, I get an exception that the config file is not found since it's being searched in the executed application (which is a separate project). I tried to set the base path but no luck with that as well.
How do I read the config file in class library in a separate project ?