In my solution I have several library projects.
I want that each library project will make some initialization when application start.
I know I can do it using static class and static method, but I don’t know if this is the best solution.
Those libraries can be used in web application or in win application.
What is the best way to do so?
EDIT:
Example: “Common” project referenced by “Transmissions” projects.
“Common” defines a structure of alerts that allows registrations. In application initialization, I want the “Transmissions” to registar its own alerts in the alerts structure of “Common”.
I would recommend using something like Managed Extensibility Framework and then you can create an interface that contains an
Initializemethod, when your application starts up you would use MEF to get all of the available libraries and call theirInitializemethod. This is a lot more flexible and lets you add and remove new components in the future.