Application Level - app.config
This is application specific and should be considered a "read-only" file
This contains settings specific to the application
<appSettings>
You can read and write these settings.
There is no type checking
They do not have user scope
They cannot be accessed and maintained from the (Project > Properties > Settings) dialog box.
<configuration>
<appSettings>
<add key="Timeout" value="400"/>
</appSettings>
</configuration>
System.Configuration.ConfigurationManager.AppSettings["TimeOut"];
System.Configuration.ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None)
<applicationSettings>
These are read only settings
There is type checking
They can be accessed and maintained from the (Project > Properties > Settings) dialog box.
<configuration>
<applicationSettings>
<ProjectName.Properties.Settings>
<Setting name="TimeOut" serializeAs="String">
<value>"400"</value>
</Setting>
</ProjectName.Properties.Settings>
</applicationSettings>
</configuration>
System.Configuration.ConfigurationManager.AppSettings["TimeOut"];
System.Configuration.ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None)
Properties.Settings.Default
If you want to persist the changes call the Save method.
Properties.Settings.Default.Save
Properties.Settings.Default.Properties["TimeOut"]
This appears as app.config in your IDE and is then automatically renamed when the project is built.
Application settings allow you to store and retrieve settings and other information dynamically
Exact FileName
The name of this file depends on the type of application.
Executables / Addins - file name is "nameofapplication".config
Web Services
Property | Description |
MaxBufferSize | The maximum size of the buffer to use |
For buffered messages this value is the same as MaxReceivedMessageSize | |
For streamed messages this value is the maximum size of the SOAP headers which must be read in buffered mode. | |
MaxReceivedMessageSize | Must match the "MaxBufferSize" |
MaxStringContentLength | The maximum string length returned by the reader |
When deserializing the message this property is used to block messages over a certain size. |
© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext