File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
src/Microsoft.AspNetCore.NodeServices/Configuration Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,6 @@ public static void Main(string[] args) {
2121 // Since .NET Core 1.1, the HTTP hosting model has become basically as fast as the Socket hosting model
2222 //options.UseSocketHosting();
2323
24- options . ProjectPath = Directory . GetCurrentDirectory ( ) ;
2524 options . WatchFileExtensions = new string [ ] { } ; // Don't watch anything
2625 } ) ;
2726 var serviceProvider = services . BuildServiceProvider ( ) ;
Original file line number Diff line number Diff line change 11using System ;
22using System . Collections . Generic ;
3+ using System . IO ;
34using System . Threading ;
45using Microsoft . AspNetCore . NodeServices . HostingModels ;
56using Microsoft . Extensions . Logging ;
@@ -34,14 +35,18 @@ public NodeServicesOptions(IServiceProvider serviceProvider)
3435 InvocationTimeoutMilliseconds = DefaultInvocationTimeoutMilliseconds ;
3536 WatchFileExtensions = ( string [ ] ) DefaultWatchFileExtensions . Clone ( ) ;
3637
37- // In an ASP.NET environment, we can use the IHostingEnvironment data to auto-populate a few
38- // things that you'd otherwise have to specify manually
3938 var hostEnv = serviceProvider . GetService < IHostingEnvironment > ( ) ;
4039 if ( hostEnv != null )
4140 {
41+ // In an ASP.NET environment, we can use the IHostingEnvironment data to auto-populate a few
42+ // things that you'd otherwise have to specify manually
4243 ProjectPath = hostEnv . ContentRootPath ;
4344 EnvironmentVariables [ "NODE_ENV" ] = hostEnv . IsDevelopment ( ) ? "development" : "production" ; // De-facto standard values for Node
4445 }
46+ else
47+ {
48+ ProjectPath = Directory . GetCurrentDirectory ( ) ;
49+ }
4550
4651 var applicationLifetime = serviceProvider . GetService < IApplicationLifetime > ( ) ;
4752 if ( applicationLifetime != null )
You can’t perform that action at this time.
0 commit comments