File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
src/BenchmarksApps/TodosApi Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 1
- namespace Microsoft . Extensions . Hosting ;
1
+ using System . Reflection ;
2
+
3
+ namespace Microsoft . Extensions . Hosting ;
2
4
3
5
internal static class HostEnvironmentExtensions
4
6
{
5
- public static bool IsBuild ( this IHostEnvironment hostEnvironment ) => hostEnvironment . IsEnvironment ( "Build" ) ;
7
+ public static bool IsBuild ( this IHostEnvironment hostEnvironment )
8
+ {
9
+ // Check if the environment is "Build" or the entry assembly is "GetDocument.Insider"
10
+ // to account for scenarios where app is launching via OpenAPI build-time generation
11
+ // via the GetDocument.Insider tool.
12
+ return hostEnvironment . IsEnvironment ( "Build" ) || Assembly . GetEntryAssembly ( ) ? . GetName ( ) . Name == "GetDocument.Insider" ;
13
+ }
6
14
}
You can’t perform that action at this time.
0 commit comments