1

I create a quick little win form application that I want to deploy to a user. In my application I created several user settings so that he can configure it on his end once it's installed.

In my app.config I have:

<userSettings>
    <MyApp.Properties.Settings>
      <setting name="Custom1" serializeAs="String">
        <value>This is my value 1</value>
      </setting>
      <setting name="Custom2" serializeAs="String">
        <value>This is my value 2</value>
      </setting>      
    </MyApp.Properties.Settings>
  </userSettings>

In my Application I reference them like:

lblOne.Text = MyApp.Properties.Settings.Default.JobLocation;
lblTwo.Text = MyApp.Properties.Settings.Default.UmiLocation;

I click install and I don't see the app.config file on deployment. I just see the ClickOnce Application installed on a path on my c drive.

John Doe
  • 3,053
  • 17
  • 48
  • 75
  • that's because when you deploy an application in .net, the app.config that you see when debugging vs compiled, becomes the exeName.config also look into deploying your application as `ClickOnce App` – MethodMan May 12 '17 at 13:36
  • I don't even see that config file either – John Doe May 12 '17 at 13:37
  • you should read up on how to access .Config file in .net also go to the bin directory where you compiled the code, and look for the Executable name of the app + .Config extension for example if I wrote a program called `JDS` I would see `JDS.Exe.Config` another side not.. if you change the name of the .exe file you need to change / have a matching name.exe.config for that file as well.. – MethodMan May 12 '17 at 13:39
  • Ah yes. I am using One Click Deployment to have the client install the app. From there I don't see where its finding the config file. – John Doe May 12 '17 at 13:41
  • The actual config file (on my ClickOnce app, anyway) is called `user.config` and lives at `C:\Users\stuartd\AppData\Local\Company_Name\AppName.exe_StrongName_awasmzssygzhap4yetcetcetcixoef4\1.0.0.0`. and it contains the user settings. – stuartd May 12 '17 at 13:42
  • Hmm I don't see that in my instance.. All I see is the exe C:\Users\me\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Company_Name – John Doe May 12 '17 at 13:48
  • Have you searched AppData for Company_Name? Clickonce deployments are a big tradeoff about convenience vs "not being able to find anything" :) – stuartd May 12 '17 at 13:52
  • You could use something like procmon to see what file gets changed when you change the settings. – stuartd May 12 '17 at 13:53
  • do you have a network shared drive where you can deploy it. also how is anyone supposed to run the application if it resides on your local – MethodMan May 12 '17 at 14:12
  • Yes I palced the on click on a network folder – John Doe May 12 '17 at 14:14

0 Answers0