I am working on an MVC application using Entity Framework.
After creating an EDMX, I noticed the DB connection string is located in TWO places – an app.config file in my Data class library, and a web.config file in my web application.
We want to:
-
remove these two plain text connection strings
-
encrypt a single connection string
-
and use our pre-existing class library to decrypt the connection string when needed
I tried removing one or the other connection string from the config files, and DB access fails. Why are TWO required? And is there any way to do what we want in an MVC – EF project, and how would I tell EF that is what we are doing?
Thanks!
You can ignore the connection string in your EF project, I think, and just set the connection programmatically from your controller.