0

I have an MVC website that also references another Class project in my solution called DAL

The MVC website has a settings.settings file that I am using for my Default database connection string, and this automatically gets updated in my Web.Config file.

However my Class project also uses a settings.settings file for a database connection (to create a connection if one is not already supplied to it by the MVC project) and I believe this is put into the App.Config file, but when it comes to deploying and running this MVC website?

What do I do for the DAL project?

I can see it has a DAL\bin\release\DAL.dll.config file in that location, does this need to go into the root of the website directory, using the same file path? or should I be doing something else?

Thanks

1 Answer 1

1

You should be able to override this setting in your web.config by using the full name. If your project is called DAL you should create a connection string in your web.config which looks something like.

<add name="DAL.Properties.Settings.MyDatabaseConnectionString" 
    connectionString="Data Source=(local);Initial Catalog=myDatabase;Integrated Security=true"
    providerName="System.Data.SqlClient" />
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks that helped me come up with something, but in my case the DAL project is not referenced in the WebUI at all.

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.