I know the title looks somewhat confusing so let me explain. 🙂
I have a MVC 3.0 Project for which I maintain a public repository @ github, and said Project utilizes the Entity Framework and the Membership Provider (so that’s two separate connectionStrings) .
The issue I am having is that the “Alias” attribute of Sequilizer for the MS SQL database, let’s me specify only one connectionString value to be replaced at build time. Because I can not modify web.config programmatically (and web.config transformations are not applicable because it will leave my sensitive data open to the World on the public github repo), I am left to choose which I want to use more -> Entity or Membership (the other solution would be leaving one of my connectionStrings vulnerable) .
Due to the need of MembershipProvider to know the connectionStringName at build time (everything is specified in web.config), I am kinda at a loss of how to go about all this.
Any help is appreciated!
Cheers
Okay guys, I think I set up everything finally.
What I did is, I used the Alias only for my normal connection string which will provide Membership stuff – while I overrode the ObjectContext default constructor (in “MyProjectEntities.Designer.cs”) to use Configuration Variable (named “EntityFramework”) that I set up on AppHarbor which holds the Entity Framework connectionString like so:
Tested and works as I wanted it to work. 🙂