Home > Net >  C # in the App. What is the meaning of the config? Use the TXT instead?
C # in the App. What is the meaning of the config? Use the TXT instead?

Time:12-20

Recently, as the topic, research of c # App configuration files related to the operation, with half dead, although finally settled, but also had a lot of trouble;
Mainly the following two questions:
1, can only read & lt; AppSettings> Nodes of content, content cannot read other nodes;
2, read is very easy, but often does not change after writing,

The sudden think today, I do this bird trouble? I directly in the program folder out a TXT file, with the key, the value of the format to write several lines;
A word of the file. The readline (), or writeline () is not solved? What the trouble, the above two problem has been solved the

I want to wrong? I think it must be I think simple, this wave of Microsoft operating is the meaning of what I can think of?

CodePudding user response:

Appconfig configuration to process than is the value to the business configuration, appset and connstr is conveniently implemented

Business configuration, how do you achieve

CodePudding user response:

XML is the product of The Times, to force corresponding with memory object, to ensure the integrity of the configuration file, netcore already give up this thing, to switch to json as the default configuration,

CodePudding user response:

See netcore configuration file, put a appsettings. He is in the root directory json just a matter of,
Even Blazor WebAssembly configuration is also such, so, don't have to struggle
  •  Tags:  
  • C#
  • Related