-1

I have an app that was designed for a per user install. The users can choose between different databases, a connection string gets set based on their choice and they go about doing their work. This all works fine so long as the user is the only person with access to their config file.

However, a few clients have recently started running it on a terminal server. The problem i am running into is user A logs in, selects database a, then user b logs in, selects database b which switches user A's connection so he is now pointing at b as well.

What is the recommended way to ensure a unique config file per user in a terminal environment?

Muckeypuck
  • 549
  • 2
  • 14
  • 1
    This is just off the top of my head... Could you set up a common database to store the connection strings? The application itself would have access to this database, but the users would not. And as multiple users create accounts (or install it), this common database logs the user and their connection string. – Casey Crookston Aug 21 '19 at 14:39
  • @CaseyCrookston its a good idea. Moving settings mentioned below would probably be an easier implementation but if not, id definitely come back to this – Muckeypuck Aug 21 '19 at 14:44
  • Possible duplicate of [Programming .NET apps for Citrix/Terminal server: Compliance and Pitfalls](https://stackoverflow.com/questions/2988998/programming-net-apps-for-citrix-terminal-server-compliance-and-pitfalls) – TnTinMn Aug 21 '19 at 14:47

1 Answers1

1

As long as you store you config data in a user dedicated folder, you should not have a conflict. This works in Terminal Server, Multi user on a same desktop and Citrix.

Grab the user local directory (create your own dir for storage under this path):

Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)

or

%APPDATA%
EylM
  • 5,967
  • 2
  • 16
  • 28
  • 1
    this would indeed be cheap and easy. Let me fiddle around with this and if it works ill accept it as the answer – Muckeypuck Aug 21 '19 at 14:45