I have a Windows App and Web App.
I have a common business logic layer that I want to use to call some settings from.
In the Web app I want to call settings from the web config
If its a Windows app I want to call them from the registry.
MyApp.Windows
MyApp.WebApp
These both call the business logic app
MyApp.BusinessLogic
Is there any way of identifying the calling assembly ?
You should not make this kind of decision in the library. The library should take it’s setting via passing in some kind of config object, to a constructor or a method. THen you just populate that config object from the registry in the windows app and the config file in the web app. That way the library does not need to know where it is getting called from.