Connection string in app.config - Clickonce

Connection string in app.config - Clickonce

Old forum URL: forums.lhotka.net/forums/t/7377.aspx


kyle.l.watson@gmail.com posted on Friday, July 31, 2009

I'm trying to keep my connection string off the client, theoretically, it doesn't need to be on the client, just the middle tier.

Given the structure of the pt example, the PTWin client references the PTLibrary and the ptLibrary refernces the datalayer. In this scenario, does the connection string get published ( I think it is stored in an app.config file in the datalayer project ).

I guess my deep question is, what gets published to the client when you reference an assembly that refences another assembly?

From the look of it, it seems that it simply would publish all 3 assemblies to the client. So is that app.config file part of the datalayer assembly which then can be opened up using a reflector tool on the client?

RockfordLhotka replied on Friday, July 31, 2009

ProjectTracker isn't a great example for your scenario, because I designed it to switch transparently between 2- and 3-tier deployments for demo purposes. All that really means is that my UI projects have more references than they strictly need to operate.

Most notably, the UI projects reference the DAL project, thus ensuring that the DAL DLL gets deployed to the client, which is required for a 2-tier deployment.

If you are doing a 3-tier deployment you don't want (or need) the DAL DLL to go to the client. There's no reason to reference it from the UI project, and so it shouldn't show up as a dependency in ClickOnce.

kyle.l.watson@gmail.com replied on Friday, July 31, 2009

oh perfect. You are absolutely right and I should have remembered that PT was used both for both 2 and 3 tier deployment.

Having removed the dal dependency from the client, everything works perfectly while the Connection string remains on the middle tier.

Thanks for quickly clearing that up for me.

Copyright (c) Marimer LLC