1

I have a solution with three projects:

  1. A web application (WA)
  2. A Data Model Layer (DML) using code first, and
  3. A Data Access Layer (DAL)

The WA’s web.config and the DML's app.config each have a connection string section specifying a connection string for the database.

I've noticed that the DML connection string doesn't really matter. So is it safe to completely remove this section from the app.config file?

Also, why is this string unused? Finally, I'm guessing when the application is run, the connection to the database is established using the connection string in the web.config file and the database definition is managed by the DML/DAL?

Is this because the other projects aren’t really being run per se, just the methods and properties are being referenced? Thanks

2 Answers 2

1

Yes, you can remove connection string from DML's app.config. It is unused because you are starting the web application and only it's config does matter at runtime.

Sign up to request clarification or add additional context in comments.

Comments

0

Everything needs to go into your app.config / web.config. The config files on the library project only help you to keep track of things that need to go into your app.config

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.