We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7078bda commit eabe6afCopy full SHA for eabe6af
1 file changed
src/BenchmarksApps/TodosApi/HostEnvironmentExtensions.cs
@@ -1,6 +1,14 @@
1
-namespace Microsoft.Extensions.Hosting;
+using System.Reflection;
2
+
3
+namespace Microsoft.Extensions.Hosting;
4
5
internal static class HostEnvironmentExtensions
6
{
- 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
+ }
14
}
0 commit comments