File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -116,7 +116,8 @@ public Server(ServerArgs? args = null)
116116 } ;
117117
118118 Services . AddSingleton ( _args ) ;
119- Services . AddSingleton ( Configuration ) ;
119+ // capture the latest Configuration instance at resolution time in case it gets replaced by UseConfiguration()
120+ Services . AddSingleton ( _ => Configuration ) ;
120121
121122 AddDefaultApps ( ) ;
122123 }
@@ -209,14 +210,12 @@ public Server UseCulture(string cultureName)
209210 public Server UseConfiguration ( IConfiguration configuration )
210211 {
211212 Configuration = configuration ;
212- Services . AddSingleton ( Configuration ) ;
213213 return this ;
214214 }
215215
216216 public Server UseConfiguration ( Action < IConfigurationBuilder > configure )
217217 {
218218 Configuration = ServerUtils . GetConfiguration ( configure ) ;
219- Services . AddSingleton ( Configuration ) ;
220219 return this ;
221220 }
222221
You can’t perform that action at this time.
0 commit comments