Why are .net configuration settings compiled into assemblies?

I am trying to read how to properly configure the configuration in .net and run something that I find a little strange, and that the configuration parameters are compiled into assemblies through the Settings class. Removing app.config and running the application does not result in configuration errors, as I expected, but now I have no way to replace the configuration values.

In my application, I have a configuration parameter for the webservice url that I need to be able to select and install programmatically. Do I have to create custom sections in the configuration for my application, which I will read through ConfigurationManager.GetSection (..) to cause the configuration file to be read, or is there another way to solve this problem, since I absolutely do not want the webservice URL to use generating a ws proxy as a URL that could potentially leak during production.

Please, help.

+3
source share
7 answers

, . .

+1

look .NET?

.NET

+1

, , settings.designer.cs

, , .

.

- , .

0

-, , URL- - (.. ).

"-". - " URL" "" "".

, , - URL-, .

0

( ),.Net , Windows, , .

(C:\Documents and settings\yourusername\Local Setting\Application Data\ ) , . ,.

, - , web.config( , ) ?

0

, webservice , app.config( web.config) , ... ... URL webservice. Framework 1.1 2.0.

Settings.settings... 3.0 . web.config, Settings.settings, ... . webservice , , .

... Settings.settings , , - .

:

0

, , , . , - www.productionurl.com, - url . , url ( , Dynamic).

, 2 :

  • Reference.cs( - )
  • URL

, - . , - .

0

Source: https://habr.com/ru/post/1702751/


All Articles