I have a .NET 3.5 assembly, a DAL, that connects to a database through Linq2SQL.
I deploy this assembly in the GAC as it can be used by multiple business layers.
The question is: in a dev environment I have a connection string different than the one in the production environment. Before deploying the assembly to the prod GAC I need to recompile it with the appropriate connection string.
Is there any way to allow deploying the assembly to the GAC independently of the connection string, being that info read from some config?
It doesn’t matter whether you deploy the assembly to the GAC or in the bin folder of a website, the config of the application that uses the assembly is the one that overrides the connection in the LinqToSQL classes.
You should pass this connection string in from the config when you create the data context