Im writing an web app that consists of a 3 projects. The ASP.net MVC5 website, a windows service which runs jobs which users schedule using the website, and then a class library which the other two projects reference. I have a JSON config file that the class library references. It contains data as to how jobs should run. I want to include it in my source control and I want it to be JSON so my colleagues who use the app can easily change it without having to recompile the solution. Only the class library needs to access the json file - the other two projects reference the class library so they essentially reference the settings in the json file by accessing classes in the class library.
My issue is, i am referencing the json config file path in the class library classes like so: AppDomain.CurrentDomain.BaseDirectory + "config.json"
However, when the web server instantiates a class from the class library the path resolves the the base directory of the web server instead of the class library, which isn't surprising.
Whats the best way to do this? Can I keep the config file permanently in the webapp project and then have a link to the config file in the windows service project perhaps? Not sure how that would work after deployment of the solution though?
Web project is .NET standard MVC 5. JSON much preferred over XML for config file type.