Configuration and multiple solutions/applications

Posts   
 
    
wvnoort
User
Posts: 96
Joined: 06-Jan-2005
# Posted on: 09-May-2005 16:17:01   

Hi all,

At the moment I have two solutions that share the same databases. Both solutions use LLBLGen and are deployed together (one is a generic NT-Service, the other one is the actual application). Until now I have copied the connection info from the configuration file of the application to the .config of the service.

There must be a better way, that allows me to share the connection data between the applications. But I think a need a hint to start me up....

jeffreygg
User
Posts: 805
Joined: 26-Oct-2003
# Posted on: 09-May-2005 19:17:34   

wvnoort wrote:

Hi all,

At the moment I have two solutions that share the same databases. Both solutions use LLBLGen and are deployed together (one is a generic NT-Service, the other one is the actual application). Until now I have copied the connection info from the configuration file of the application to the .config of the service.

There must be a better way, that allows me to share the connection data between the applications. But I think a need a hint to start me up....

You could create a new .dll that returns a new connection string when asked. You can then use this new connection string to override the default connection string set up in each of your solutions. The docs explain how to override the default connection string...

Jeff...

wvnoort
User
Posts: 96
Joined: 06-Jan-2005
# Posted on: 10-May-2005 09:14:05   

thanks Jeff,

As a check whether I understand what you are saying, i'll try to reformulate it in my own words:

Create a new dll, let's call it 'dbconfig.dll'. This gets the responsibility of reading the configuration file 'dbconfig.config'. The new dll and the corresponding config file are deployed somewhere (the same folder as the one where the application is deployed).

Reference the new dll from the service (and all other apps that need the configuration). When deploying add the private probing path to the app.config of the application so the service can find the dbconfig.dll.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 10-May-2005 09:43:37   

You can also embed the connection string in the dll. That's how I did it for years in VB/C++ COM components in MTS/COM+ -> one component was the connection string supplier for the rest of the components in the app.

Frans Bouma | Lead developer LLBLGen Pro