16 implementations of ApplicationName
Aspire.Dashboard.Tests (1)
BrowserSecurityHeadersMiddlewareTests.cs (1)
90public string ApplicationName { get; set; } = "ApplicationName";
Aspire.Hosting.Tests (1)
Dashboard\DashboardServiceTests.cs (1)
150public string ApplicationName { get; set; } = default!;
Microsoft.AspNetCore.Components.Endpoints.Tests (5)
Builder\RazorComponentsEndpointConventionBuilderExtensionsTest.cs (1)
289public string ApplicationName { get; set; } = "TestApplication";
HotReloadServiceTests.cs (1)
276public string ApplicationName { get; set; } = "TestApplication";
RazorComponentEndpointDataSourceTest.cs (1)
292public string ApplicationName { get; set; } = "TestApplication";
RazorComponentEndpointInvokerTest.cs (1)
59public string ApplicationName { get => "Test"; set => throw new NotImplementedException(); }
RazorComponentsServiceCollectionExtensionsTest.cs (1)
144public string ApplicationName { get; set; } = "App";
Microsoft.AspNetCore.Grpc.Swagger.Tests (1)
Infrastructure\TestWebHostEnvironment.cs (1)
13public string ApplicationName { get; set; }
Microsoft.AspNetCore.Hosting (1)
Internal\HostingEnvironment.cs (1)
17public string? ApplicationName { get; set; }
Microsoft.AspNetCore.Mvc.RazorPages.Test (1)
Builder\PageActionEndpointConventionBuilderResourceCollectionExtensionsTest.cs (1)
261public string ApplicationName { get; set; } = "TestApplication";
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (1)
Builder\ControllerActionEndpointConventionBuilderResourceCollectionExtensionsTest.cs (1)
337public string ApplicationName { get; set; } = "TestApplication";
Microsoft.AspNetCore.OpenApi.Tests (1)
Services\OpenApiGeneratorTests.cs (1)
1031public string ApplicationName { get; set; }
Microsoft.AspNetCore.Routing.Tests (1)
RouteHandlerOptionsTests.cs (1)
71public string ApplicationName { get; set; }
Microsoft.AspNetCore.Server.Kestrel.Tests (1)
KestrelConfigurationLoaderTests.cs (1)
1876public string ApplicationName { get; set; }
Microsoft.AspNetCore.SpaServices.Extensions.Tests (1)
SpaServicesExtensionsTests.cs (1)
104public string ApplicationName { get; set; }
Microsoft.Extensions.Hosting (1)
Internal\HostingEnvironment.cs (1)
26public string ApplicationName { get; set; } = string.Empty;
1 write to ApplicationName
Microsoft.AspNetCore.Hosting (1)
Internal\HostingEnvironmentExtensions.cs (1)
73hostingEnvironment.ApplicationName = baseEnvironment?.ApplicationName ?? options.ApplicationName;
109 references to ApplicationName
Aspire.Hosting (4)
DistributedApplicationBuilder.cs (1)
154var appHostName = options.ProjectName ?? _innerBuilder.Environment.ApplicationName;
ParameterResourceBuilderExtensions.cs (2)
131value = new UserSecretsParameterDefault(builder.AppHostAssembly, builder.Environment.ApplicationName, name, value); 329parameterResource.Default = new UserSecretsParameterDefault(builder.AppHostAssembly, builder.Environment.ApplicationName, name, parameterResource.Default);
Utils\VolumeNameGenerator.cs (1)
31var safeApplicationName = Sanitize(builder.ApplicationBuilder.Environment.ApplicationName).ToLowerInvariant();
Aspire.Hosting.Tests (4)
Utils\TestDistributedApplicationBuilder.cs (1)
47$"{VolumeNameGenerator.Sanitize(Environment.ApplicationName).ToLowerInvariant()}-{Configuration["AppHost:Sha256"]!.ToLowerInvariant()[..10]}";
Utils\VolumeNameGeneratorTests.cs (3)
17var volumePrefix = $"{Sanitize(builder.Environment.ApplicationName).ToLowerInvariant()}-{builder.Configuration["AppHost:Sha256"]!.ToLowerInvariant()[..10]}"; 58var runVolumePrefix = $"{Sanitize(runBuilder.Environment.ApplicationName).ToLowerInvariant()}-{runBuilder.Configuration["AppHost:Sha256"]!.ToLowerInvariant()[..10]}"; 59var publishVolumePrefix = $"{Sanitize(publishBuilder.Environment.ApplicationName).ToLowerInvariant()}-{publishBuilder.Configuration["AppHost:Sha256"]!.ToLowerInvariant()[..10]}";
Aspire.Playground.Tests (4)
Infrastructure\DistributedApplicationExtensions.cs (3)
116var appHostLogs = logs.Where(l => l.Category?.StartsWith($"{environment.ApplicationName}.Resources") == false).ToList(); 117var resourceLogs = logs.Where(l => l.Category?.StartsWith($"{environment.ApplicationName}.Resources") == true).ToList(); 133var assertableResourceLogNames = applicationModel.Resources.Where(ShouldAssertErrorsForResource).Select(r => $"{environment.ApplicationName}.Resources.{r.Name}").ToList();
Infrastructure\DistributedApplicationTestFactory.cs (1)
51logging.AddFilter(builder.Environment.ApplicationName, LogLevel.Trace);
CreateDefaultBuilderApp (1)
Program.cs (1)
34return context.Response.WriteAsync(responseMessage ?? hostingEnvironment.ApplicationName);
CreateDefaultBuilderOfTApp (1)
Program.cs (1)
45return context.Response.WriteAsync(responseMessage ?? hostingEnvironment.ApplicationName);
IStartupInjectionAssemblyName (1)
Program.cs (1)
15var applicationName = webHost.Services.GetRequiredService<IHostEnvironment>().ApplicationName;
Microsoft.AspNetCore (5)
WebApplicationBuilder.cs (3)
221webHostBuilder.UseSetting(WebHostDefaults.ApplicationKey, _hostApplicationBuilder.Environment.ApplicationName ?? ""); 276if (env.IsDevelopment() && env.ApplicationName is { Length: > 0 }) 280var appAssembly = Assembly.Load(new AssemblyName(env.ApplicationName));
WebHost.cs (2)
177if (!string.IsNullOrEmpty(env.ApplicationName)) 179var appAssembly = Assembly.Load(new AssemblyName(env.ApplicationName));
Microsoft.AspNetCore.Components.Server (1)
Circuits\CircuitOptionsJavaScriptInitializersConfiguration.cs (1)
21var file = _environment.WebRootFileProvider.GetFileInfo($"{_environment.ApplicationName}.modules.json");
Microsoft.AspNetCore.Components.Server.Tests (1)
ComponentEndpointRouteBuilderExtensionsTest.cs (1)
128environment.SetupGet(e => e.ApplicationName).Returns("app");
Microsoft.AspNetCore.Components.WebAssembly.Server (2)
DebugProxyLauncher.cs (2)
120if (string.IsNullOrEmpty(environment.ApplicationName)) 124var assembly = Assembly.Load(environment.ApplicationName);
Microsoft.AspNetCore.Hosting (5)
Internal\HostingEnvironmentExtensions.cs (1)
73hostingEnvironment.ApplicationName = baseEnvironment?.ApplicationName ?? options.ApplicationName;
Internal\WebHostOptions.cs (1)
20ApplicationName = environment?.ApplicationName ?? GetConfig(WebHostDefaults.ApplicationKey) ?? Assembly.GetEntryAssembly()?.GetName().Name ?? string.Empty;
StaticWebAssets\StaticWebAssetsLoader.cs (3)
71if (string.IsNullOrEmpty(environment.ApplicationName)) 75var assembly = Assembly.Load(environment.ApplicationName); 78return Path.Combine(basePath!, $"{environment.ApplicationName}.staticwebassets.runtime.json");
Microsoft.AspNetCore.Hosting.Tests (7)
WebHostBuilderTests.cs (7)
736Assert.Equal(typeof(Startup).Assembly.GetName().Name, hostingEnv.ApplicationName); 754Assert.Equal(typeof(StartupNoServicesNoInterface).Assembly.GetName().Name, hostingEnv.ApplicationName); 769Assert.Equal(typeof(StartupNoServicesNoInterface).Assembly.GetName().Name, hostingEnv.ApplicationName); 784Assert.Equal(typeof(WebHostBuilderTests).Assembly.GetName().Name, hostingEnv.ApplicationName); 800Assert.Equal(typeof(WebHostBuilderTests).Assembly.GetName().Name, hostingEnv.ApplicationName); 814Assert.Equal("Microsoft.AspNetCore.Hosting.Tests", hostingEnv.ApplicationName); 828Assert.Equal("Microsoft.AspNetCore.Hosting.Tests", hostingEnv.ApplicationName);
Microsoft.AspNetCore.Identity.UI (1)
IdentityBuilderUIExtensions.cs (1)
73?.ApplicationName;
Microsoft.AspNetCore.Mvc.ApiExplorer (1)
EndpointMetadataApiDescriptionProvider.cs (1)
97controllerName = _environment.ApplicationName ?? string.Empty;
Microsoft.AspNetCore.Mvc.Core (1)
DependencyInjection\MvcCoreServiceCollectionExtensions.cs (1)
79var entryAssemblyName = environment?.ApplicationName;
Microsoft.AspNetCore.Mvc.Core.Test (3)
DependencyInjection\MvcCoreServiceCollectionExtensionsTest.cs (3)
152environment.SetupGet(e => e.ApplicationName).Returns((string)null).Verifiable(); 176environment.SetupGet(e => e.ApplicationName).Returns((string)null).Verifiable(); 198environment.SetupGet(e => e.ApplicationName).Returns(applicationName).Verifiable();
Microsoft.AspNetCore.Mvc.Localization (2)
ViewLocalizer.cs (2)
33if (string.IsNullOrEmpty(hostingEnvironment.ApplicationName)) 38_applicationName = hostingEnvironment.ApplicationName;
Microsoft.AspNetCore.Mvc.Localization.Test (10)
ViewLocalizerTest.cs (10)
31hostingEnvironment.Setup(a => a.ApplicationName).Returns(appName); 55hostingEnvironment.Setup(a => a.ApplicationName).Returns("TestApplication"); 87hostingEnvironment.Setup(a => a.ApplicationName).Returns("TestApplication"); 121hostingEnvironment.Setup(a => a.ApplicationName).Returns("TestApplication"); 146hostingEnvironment.Setup(a => a.ApplicationName).Returns("TestApplication"); 172hostingEnvironment.Setup(a => a.ApplicationName).Returns("TestApplication"); 196hostingEnvironment.Setup(a => a.ApplicationName).Returns("TestApplication"); 220hostingEnvironment.Setup(a => a.ApplicationName).Returns("TestApplication"); 244hostingEnvironment.Setup(a => a.ApplicationName).Returns("TestApplication"); 268hostingEnvironment.Setup(a => a.ApplicationName).Returns("TestApplication");
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (2)
CSharpCompiler.cs (2)
91if (!string.IsNullOrEmpty(_hostingEnvironment.ApplicationName)) 93var applicationAssembly = Assembly.Load(new AssemblyName(_hostingEnvironment.ApplicationName));
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.Test (1)
CSharpCompilerTest.cs (1)
24var hostingEnvironment = Mock.Of<IWebHostEnvironment>(e => e.ApplicationName == name);
Microsoft.AspNetCore.Mvc.Razor.Test (1)
DependencyInjection\MvcRazorMvcCoreBuilderExtensionsTest.cs (1)
39.Setup(h => h.ApplicationName)
Microsoft.AspNetCore.Mvc.Test (2)
MvcOptionsSetupTest.cs (1)
308hostingEnvironment.SetupGet(e => e.ApplicationName)
MvcServiceCollectionExtensionsTest.cs (1)
673.Setup(e => e.ApplicationName)
Microsoft.AspNetCore.OpenApi (1)
Services\OpenApiGenerator.cs (1)
354controllerName = _environment?.ApplicationName ?? string.Empty;
Microsoft.AspNetCore.Server.Kestrel.Core (1)
TlsConfigurationLoader.cs (1)
35_applicationName = hostEnvironment.ApplicationName;
Microsoft.AspNetCore.StaticAssets (3)
Infrastructure\StaticAssetsEndpointDataSourceHelper.cs (1)
60return Path.Combine(AppContext.BaseDirectory, $"{environment.ApplicationName}.staticwebassets.endpoints.json");
StaticAssetsEndpointRouteBuilderExtensions.cs (2)
23/// The <paramref name="staticAssetsManifestPath"/> can be <see langword="null"/> to use the <see cref="IHostEnvironment.ApplicationName"/> to locate the manifest. 31staticAssetsManifestPath ??= $"{environment.ApplicationName}.staticwebassets.endpoints.json";
Microsoft.AspNetCore.Tests (31)
WebApplicationTests.cs (31)
746Assert.Equal(nameof(WebApplicationTests), webApplication.Environment.ApplicationName); 808Assert.Equal(nameof(WebApplicationTests), context.HostingEnvironment.ApplicationName); 814Assert.Equal(nameof(WebApplicationTests), builder.Environment.ApplicationName); 857Assert.Equal(nameof(WebApplicationTests), context.HostingEnvironment.ApplicationName); 863Assert.Equal(nameof(WebApplicationTests), builder.Environment.ApplicationName); 903Assert.Equal(nameof(WebApplicationTests), context.HostingEnvironment.ApplicationName); 909Assert.Equal(nameof(WebApplicationTests), builder.Environment.ApplicationName); 934Assert.Equal(assemblyName, context.HostingEnvironment.ApplicationName); 938Assert.Equal(assemblyName, builder.Environment.ApplicationName); 941Assert.Equal(assemblyName, context.HostingEnvironment.ApplicationName); 946Assert.Equal(assemblyName, context.HostingEnvironment.ApplicationName); 953Assert.Equal(assemblyName, hostEnv.ApplicationName); 954Assert.Equal(assemblyName, webHostEnv.ApplicationName); 976Assert.Equal(assemblyName, context.HostingEnvironment.ApplicationName); 980Assert.Equal(assemblyName, builder.Environment.ApplicationName); 983Assert.Equal(assemblyName, context.HostingEnvironment.ApplicationName); 988Assert.Equal(assemblyName, context.HostingEnvironment.ApplicationName); 995Assert.Equal(assemblyName, hostEnv.ApplicationName); 996Assert.Equal(assemblyName, webHostEnv.ApplicationName); 1482Assert.Equal(env0.ApplicationName, env1.ApplicationName); 2258Assert.Equal(builder.Environment.ApplicationName, hostEnv.ApplicationName); 2262Assert.Equal(webHostEnv.ApplicationName, hostEnv.ApplicationName); 2266Assert.NotEqual(nameof(WebApplicationTests), hostEnv.ApplicationName); 2288Assert.Equal(builder.Environment.ApplicationName, hostEnv.ApplicationName); 2292Assert.Equal(webHostEnv.ApplicationName, hostEnv.ApplicationName); 2296Assert.Equal(typeof(WebApplicationOptions).Assembly.FullName, hostEnv.ApplicationName);
Microsoft.Extensions.AmbientMetadata.Application (1)
ApplicationMetadataSource.cs (1)
47{ $"{SectionName}:{nameof(ApplicationMetadata.ApplicationName)}", _hostEnvironment.ApplicationName },
Microsoft.Extensions.AmbientMetadata.Application.Tests (2)
ApplicationMetadataExtensionsTests.cs (1)
29_hostEnvironment.Setup(h => h.ApplicationName).Returns(TestApplicationName);
ApplicationMetadataSourceTests.cs (1)
25_hostEnvironment.Setup(h => h.ApplicationName).Returns(TestApplicationName);
Microsoft.Extensions.Hosting (3)
HostingHostBuilderExtensions.cs (2)
244if (env.IsDevelopment() && env.ApplicationName is { Length: > 0 }) 248var appAssembly = Assembly.Load(new AssemblyName(env.ApplicationName));
Internal\Host.cs (1)
441return $@"ApplicationName = ""{_hostEnvironment.ApplicationName}"", IsRunning = {(IsRunning ? "true" : "false")}";
Microsoft.Extensions.Hosting.Abstractions (1)
HostDefaults.cs (1)
12/// The configuration key used to set <see cref="IHostEnvironment.ApplicationName"/>.
Microsoft.Extensions.Hosting.WindowsServices (1)
WindowsServiceLifetimeHostBuilderExtensions.cs (1)
131_applicationName = environment.ApplicationName;
Microsoft.Extensions.Telemetry.Tests (2)
Enrichment\ApplicationLogEnricherTests.cs (2)
27_hostMock.SetupGet(c => c.ApplicationName).Returns(AppName); 70ApplicationName = _hostMock.Object.ApplicationName,
StartRequestDelegateUrlApp (1)
Program.cs (1)
24await context.Response.WriteAsync(env.ApplicationName);
StartRouteBuilderUrlApp (1)
Program.cs (1)
25await res.WriteAsync(env.ApplicationName);
StartWithIApplicationBuilderUrlApp (1)
Program.cs (1)
27await context.Response.WriteAsync(env.ApplicationName);