Last post Aug 18, 2017 02:13 PM by gunderj
Aug 18, 2017 04:06 AM|gunderj|LINK
for VS 2013 in my MVC5 web application solution, I need to add a windows service that will use the same web.config file. Is this possible for the web app and windows service to use the same web.config? Specifically, I want both to access the connect strings.
I tried right-click on the solution but I do not see a choice that would allow this. Thanks if you can advise if this is possible and what steps to take.
Aug 18, 2017 04:42 AM|a2h|LINK
Is this possible for the web app and windows service to use the same web.config?
Web App will use the config settings from Web.config file. However For window service you have a app.config file.
Specifically, I want both to access the connect strings.
You can add the same connectionstrings to both config files. By this way same connectionstring is used in both projects
Aug 18, 2017 05:00 AM|a2h|LINK
I tried right-click on the solution but I do not see a choice that would allow this.
To add a window service to existing project. You can follow below steps
You can take a look at the screenshots in this article : https://blogs.technet.microsoft.com/sams_blog/2014/06/12/windows-service-how-to-write-and-install/
Aug 18, 2017 02:13 PM|gunderj|LINK
Yes I can have duplicate connect strings for the two files web.config and app.config, but I am trying to avoid this. I would hope that since the two projects are in the same solution, then I could have the connect strings in one file only?