@@ -25,23 +25,21 @@ public class Program
25
25
/// </summary>
26
26
public static IHost BuildWebHost ( string [ ] args ) =>
27
27
Host . CreateDefaultBuilder ( args )
28
- . ConfigureHostConfiguration ( cb =>
28
+ . ConfigureHostConfiguration ( config =>
29
29
{
30
30
var applicationPath = args . SkipWhile ( a => a != "--applicationpath" ) . Skip ( 1 ) . FirstOrDefault ( ) ;
31
- var name = Path . ChangeExtension ( applicationPath , ".StaticWebAssets.xml" ) ;
31
+ var applicationDirectory = Path . GetDirectoryName ( applicationPath ) ;
32
+ var name = Path . ChangeExtension ( applicationPath , ".StaticWebAssets.xml" ) ;
32
33
33
- if ( name != null )
34
+ var inMemoryConfiguration = new Dictionary < string , string >
34
35
{
35
- cb . AddInMemoryCollection ( new Dictionary < string , string >
36
- {
37
- [ WebHostDefaults . StaticWebAssetsKey ] = name
38
- } ) ;
39
- }
40
- } )
41
- . ConfigureLogging ( logging =>
42
- {
43
- logging . SetMinimumLevel ( LogLevel . Warning ) ;
44
- logging . AddFilter ( "Microsoft.Hosting.Lifetime" , LogLevel . Information ) ;
36
+ [ "Logging:LogLevel:Microsoft" ] = "Warning" ,
37
+ [ "Logging:LogLevel:Microsoft.Hosting.Lifetime" ] = "Information" ,
38
+ [ WebHostDefaults . StaticWebAssetsKey ] = name ,
39
+ } ;
40
+
41
+ config . AddInMemoryCollection ( inMemoryConfiguration ) ;
42
+ config . AddJsonFile ( Path . Combine ( applicationDirectory , "blazor-devserversettings.json" ) , optional : true , reloadOnChange : true ) ;
45
43
} )
46
44
. ConfigureWebHostDefaults ( webBuilder =>
47
45
{
0 commit comments