| |

VerySource

 Forgot password?
 Register
Search
View: 740|Reply: 6

Can I make AppSettingsReader for multiple programs read the same config file?

[Copy link]

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-2-1 15:20:01
| Show all posts |Read mode
Some settings are shared.I don't want every program that needs these settings to set a copy in their own config. It would be nice if you could specify AppSettingsReader to read the specified config file!

Please give pointers!
Reply

Use magic Report

0

Threads

64

Posts

45.00

Credits

Newbie

Rank: 1

Credits
45.00

 China

Post time: 2020-3-14 08:30:01
| Show all posts
Is n’t it good to use the same Config file, why separate it?
Reply

Use magic Report

0

Threads

7

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-3-14 14:15:01
| Show all posts
No, if you have to do that, then create a service

Provide data as a service
Reply

Use magic Report

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

 Author| Post time: 2020-3-14 15:30:02
| Show all posts
For example, multiple programs need to connect to SQLSERVER. I want to put the connection settings in one config, not one for each config. In this way, if you want to change, you can change one config, and you don't have to change each one.
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-3-17 23:30:01
| Show all posts
Have a look: System.AppDomainSetup.ConfigurationFile
Reply

Use magic Report

0

Threads

20

Posts

15.00

Credits

Newbie

Rank: 1

Credits
15.00

 LAN

Post time: 2020-3-18 18:45:01
| Show all posts
Brother, can't you write an ini? Is it config?
^^^^^^^^^^^
Learning to help
Reply

Use magic Report

0

Threads

2

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 United States

Post time: 2020-3-18 23:15:01
| Show all posts
I want to be lazy.
I originally made a system cs + webservice, which was a shared connection string at first, but there was a problem. I didn't find any reason at that time. Then I tried to separate the connection string. It was no problem and depressed.
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list