I got a solution that includes 3 different projects, a Class Library, a Web Service and a Windows Service.
MySolution.DataAccessLayer (Class Library)
Using Entity-Framework 3.5 to access the database.
MySolution.WebService (Web Service)
MySolution.WindowsService (Windows Service)
My problem is that a have to include the Connection String in my Web Service/Windows Service configuration files to get it to work.
I have checked and I have the correct Connection String in my DataAccessLayer App.Config.
Why does it not use that?
It will not run that, because the DLL is loaded in the process space. Meaning that the services load the DLL and it is the service config that is used.
In other words – the service starts, loads the config file (that belongs to it), then loads the dataaccess DLL. As it already has its own config, it will not look further for the DLL config.