2

Hello programming guru's, Like the subject, I'd like to be able to be able to distribute my program as a single file, without a App.Config file with it. But no matter where I look here, the answer is always, its user-editable so we will not tell you how...

But for my app, I would want to prevent anyone, not just the user from editing the app.config. If the settings need to updated then a new version of the App would be compiled and then distributed.

I've tried changing App.Config into a Embedded Resource but that doesn't actually load it. Is there a simple way such that I can do

System.Configuration.LoadConfig("<?xml version=\"1.0\" encoding=\"utf-8\"?>
<configuration>...");
or
System.Configuration.loadAppConfig()

If that is indeed impossible, how do I set inside the program things like...

    <appSettings>
        <add key="aspnet:MaxHttpCollectionKeys" value="3000" />
        <add key="ClientTimeout" value="7200000" />
     </appSettings>
    <basicHttpBinding>
    <binding
                allowCookies="false"
                bypassProxyOnLocal="true"
                closeTimeout="00:10:00"
                maxBufferPoolSize="500000000"
                maxBufferSize="500000000"
                maxReceivedMessageSize="500000000"
                messageEncoding="Text"
                openTimeout="00:10:00"
                receiveTimeout="00:10:00"
                sendTimeout="00:10:00"
                textEncoding="utf-8"
                transferMode="Buffered"
                useDefaultWebProxy="true"
                name=**>
            </binding>
    </basicHttpBinding>
    <client>
    <endpoint address=** binding=** bindingConfiguration=** contract=** name=** />>
    </client>

I know it may seem like a silly request to the developer pro's that keeps saying app.config needs to be user-editable, but I think this is one of those questions that until it is answered, will just keep getting asked.

Ranald Fong
  • 401
  • 3
  • 12
  • A last ditch possible workaround I'd be willing to deal with would also be, maybe storing the app.config inside the %APPDATA% folder with a static name, that doesnt change with the exe's filename. – Ranald Fong Nov 14 '16 at 21:52
  • Is it possible for you to configure your WCF settings in code instead? And have you looked into the possibility of encrypting sections of the config instead? http://stackoverflow.com/questions/3349551/encrypting-app-config-file – Brendan Green Nov 14 '16 at 21:59
  • If I absolutely needed the config file to be distributed with the app.config, it would be ok for them to view it in the case of my app. Thanks for the suggestion, but the main point of the question is that I don't want to distribute 2 files over 1 file... I have enough troubles get them to copy files from a sharedrive to their local drive, or navigating to the sharedrive to double-click the most numerically highest version as it is. – Ranald Fong Nov 14 '16 at 22:05

0 Answers0