Skip to content

Commit f1cb8cd

Browse files
authored
Update to Aspire 9.2 and update .NET deps (#1877)
* Update to Aspire 9.2 and update .NET deps * Updates
1 parent 1dd68e5 commit f1cb8cd

File tree

14 files changed

+98
-87
lines changed

14 files changed

+98
-87
lines changed

src/Exceptionless.AppHost/Exceptionless.AppHost.csproj

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

3-
<Sdk Name="Aspire.AppHost.Sdk" Version="9.0.0" />
3+
<Sdk Name="Aspire.AppHost.Sdk" Version="9.2.0" />
44

55
<PropertyGroup>
66
<OutputType>Exe</OutputType>
77
<TargetFramework>net9.0</TargetFramework>
88
<ImplicitUsings>enable</ImplicitUsings>
99
<Nullable>enable</Nullable>
10-
<IsAspireHost>true</IsAspireHost>
1110
<UserSecretsId>a9c2ddcc-e51d-4cd1-9782-96e1d74eec87</UserSecretsId>
1211
</PropertyGroup>
1312

1413
<ItemGroup>
15-
<PackageReference Include="Aspire.Hosting.AppHost" Version="9.1.0" />
16-
<PackageReference Include="Aspire.Hosting.NodeJs" Version="9.1.0" />
17-
<PackageReference Include="Aspire.Hosting.Redis" Version="9.1.0" />
18-
<PackageReference Include="AspNetCore.HealthChecks.Elasticsearch" Version="8.0.1" />
14+
<PackageReference Include="Aspire.Hosting.AppHost" Version="9.2.0" />
15+
<PackageReference Include="Aspire.Hosting.NodeJs" Version="9.2.0" />
16+
<PackageReference Include="Aspire.Hosting.Redis" Version="9.2.0" />
17+
<PackageReference Include="AspNetCore.HealthChecks.Elasticsearch" Version="9.0.0" />
1918
<PackageReference Include="Foundatio.AWS" Version="11.0.8" />
2019
</ItemGroup>
2120

src/Exceptionless.AppHost/Extensions/ElasticsearchExtensions.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ public static IResourceBuilder<ElasticsearchResource> AddElasticsearch(this IDis
5656
.WithImage(ElasticsearchContainerImageTags.Image, ElasticsearchContainerImageTags.Tag)
5757
.WithImageRegistry(ElasticsearchContainerImageTags.ElasticsearchRegistry)
5858
.WithHttpEndpoint(targetPort: ElasticsearchPort, port: port, name: ElasticsearchResource.PrimaryEndpointName)
59-
.WithEndpoint(targetPort: ElasticsearchInternalPort, name: ElasticsearchResource.InternalEndpointName)
59+
.WithUrlForEndpoint(ElasticsearchResource.PrimaryEndpointName, u => u.DisplayText = "Elasticsearch")
60+
//.WithEndpoint(targetPort: ElasticsearchInternalPort, name: ElasticsearchResource.InternalEndpointName)
6061
.WithEnvironment("discovery.type", "single-node")
6162
.WithEnvironment("xpack.security.enabled", "false")
6263
.WithEnvironment("action.destructive_requires_name", "false")
@@ -86,6 +87,7 @@ public static IResourceBuilder<ElasticsearchResource> WithKibana(this IResourceB
8687
.WithImage(ElasticsearchContainerImageTags.KibanaImage, ElasticsearchContainerImageTags.Tag)
8788
.WithImageRegistry(ElasticsearchContainerImageTags.KibanaRegistry)
8889
.WithHttpEndpoint(targetPort: KibanaPort, name: containerName)
90+
.WithUrlForEndpoint(containerName, u => u.DisplayText = "Kibana")
8991
.WithEnvironment("xpack.security.enabled", "false")
9092
.ExcludeFromManifest();
9193

src/Exceptionless.AppHost/Extensions/MinIoExtensions.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ public static IResourceBuilder<MinIoResource> AddMinIo(
4141
.WithArgs("server", "/data", "--console-address", $":{MinIoResource.DefaultConsolePort}")
4242
.WithEndpoint(port: options.ApiPort, targetPort: MinIoResource.DefaultApiPort, name: MinIoResource.ApiEndpointName)
4343
.WithHttpEndpoint(port: options.ConsolePort, targetPort: MinIoResource.DefaultConsolePort, name: MinIoResource.ConsoleEndpointName)
44+
.WithUrlForEndpoint(MinIoResource.ConsoleEndpointName, u => u.DisplayText = "Storage")
4445
.ConfigureCredentials(options)
4546
.ConfigureVolume(options);
4647
}

src/Exceptionless.AppHost/Extensions/RedisExtensions.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,13 @@ public static IResourceBuilder<RedisResource> WithClearCommand(
2222

2323
return CommandResults.Success();
2424
},
25-
context => context.ResourceSnapshot.HealthStatus is HealthStatus.Healthy ? ResourceCommandState.Enabled : ResourceCommandState.Disabled);
25+
new CommandOptions
26+
{
27+
UpdateState = context =>
28+
context.ResourceSnapshot.HealthStatus is HealthStatus.Healthy
29+
? ResourceCommandState.Enabled
30+
: ResourceCommandState.Disabled
31+
});
2632
return builder;
2733
}
2834
}

src/Exceptionless.AppHost/Program.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
.WithDataVolume("exceptionless.data.v1")
77
.WithKibana(b => b.WithLifetime(ContainerLifetime.Persistent).WithContainerName("Exceptionless-Kibana"));
88

9-
var storage = builder.AddMinIo("S3", s => s.WithCredentials("guest", "password").WithPorts(9000).WithBucket("ex-events"))
9+
var storage = builder.AddMinIo("Storage", s => s.WithCredentials("guest", "password").WithPorts(9000).WithBucket("ex-events"))
1010
.WithLifetime(ContainerLifetime.Persistent)
1111
.WithContainerName("Exceptionless-Storage");
1212

@@ -15,12 +15,13 @@
1515
.WithLifetime(ContainerLifetime.Persistent)
1616
.WithContainerName("Exceptionless-Redis")
1717
.WithClearCommand()
18-
.WithRedisInsight(b => b.WithLifetime(ContainerLifetime.Persistent).WithContainerName("Exceptionless-RedisInsight"));
18+
.WithRedisInsight(b => b.WithLifetime(ContainerLifetime.Persistent).WithContainerName("Exceptionless-RedisInsight").WithUrlForEndpoint("http", u => u.DisplayText = "Cache"));
1919

2020
var mail = builder.AddContainer("Mail", "mailhog/mailhog")
2121
.WithLifetime(ContainerLifetime.Persistent)
2222
.WithContainerName("Exceptionless-Mail")
2323
.WithEndpoint(8025, 8025, "http")
24+
.WithUrlForEndpoint("http", u => u.DisplayText = "Mail")
2425
.WithEndpoint(1025, 1025);
2526

2627
builder.AddProject<Projects.Exceptionless_Job>("Jobs", "AllJobs")
@@ -31,6 +32,7 @@
3132
.WaitFor(elastic)
3233
.WaitFor(cache)
3334
.WaitFor(mail)
35+
.WithUrlForEndpoint("http", u => u.DisplayText = "Jobs")
3436
.WithHttpHealthCheck("/health");
3537

3638
var api = builder.AddProject<Projects.Exceptionless_Web>("Api", "Exceptionless")
@@ -42,16 +44,19 @@
4244
.WaitFor(elastic)
4345
.WaitFor(cache)
4446
.WaitFor(mail)
47+
.WithUrlForEndpoint("http", u => u.DisplayText = "Api")
4548
.WithHttpHealthCheck("/health");
4649

4750
builder.AddNpmApp("Web", "../../src/Exceptionless.Web/ClientApp", "dev")
4851
.WithReference(api)
4952
.WithEnvironment("ASPNETCORE_URLS", "http://localhost:5200")
53+
.WithUrlForEndpoint("http", u => u.DisplayText = "Web")
5054
.WithEndpoint(port: 5173, targetPort: 5173, scheme: "http", env: "PORT", isProxied: false);
5155

5256
builder.AddNpmApp("AngularWeb", "../../src/Exceptionless.Web/ClientApp.angular", "serve")
5357
.WithReference(api)
5458
.WithEnvironment("ASPNETCORE_URLS", "http://localhost:5200")
59+
.WithUrlForEndpoint("http", u => u.DisplayText = "Angular Web")
5560
.WithEndpoint(port: 5100, targetPort: 5100, scheme: "http", env: "PORT", isProxied: false);
5661

5762
builder.Build().Run();

src/Exceptionless.Core/Configuration/CacheOptions.cs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,26 +24,24 @@ public static CacheOptions ReadFromConfiguration(IConfiguration config, AppOptio
2424
{
2525
options.Data = cs.ParseConnectionString();
2626
options.Provider = options.Data.GetString(nameof(options.Provider));
27+
string? providerConnectionString = !String.IsNullOrEmpty(options.Provider) ? config.GetConnectionString(options.Provider) : null;
28+
29+
var providerOptions = providerConnectionString.ParseConnectionString(defaultKey: "server");
30+
options.Data ??= new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
31+
options.Data.AddRange(providerOptions);
32+
33+
options.ConnectionString = options.Data.BuildConnectionString(new HashSet<string> { nameof(options.Provider) });
2734
}
2835
else
2936
{
3037
var redisConnectionString = config.GetConnectionString("Redis");
3138
if (!String.IsNullOrEmpty(redisConnectionString))
3239
{
3340
options.Provider = "redis";
41+
options.ConnectionString = redisConnectionString;
3442
}
3543
}
3644

37-
string? providerConnectionString = !String.IsNullOrEmpty(options.Provider) ? config.GetConnectionString(options.Provider) : null;
38-
if (!String.IsNullOrEmpty(providerConnectionString))
39-
{
40-
var providerOptions = providerConnectionString.ParseConnectionString(defaultKey: "server");
41-
options.Data ??= new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
42-
options.Data.AddRange(providerOptions);
43-
}
44-
45-
options.ConnectionString = options.Data.BuildConnectionString([nameof(options.Provider)]);
46-
4745
return options;
4846
}
4947
}

src/Exceptionless.Core/Configuration/MessageBusOptions.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,30 +22,30 @@ public static MessageBusOptions ReadFromConfiguration(IConfiguration config, App
2222
options.Topic = config.GetValue<string>(nameof(options.Topic), $"{options.ScopePrefix}messages")!;
2323

2424
string? cs = config.GetConnectionString("MessageBus");
25+
2526
if (cs != null)
2627
{
2728
options.Data = cs.ParseConnectionString();
2829
options.Provider = options.Data.GetString(nameof(options.Provider));
30+
string? providerConnectionString = !String.IsNullOrEmpty(options.Provider) ? config.GetConnectionString(options.Provider) : null;
31+
32+
var providerOptions = providerConnectionString.ParseConnectionString(defaultKey: "server");
33+
options.Data ??= new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
34+
options.Data.AddRange(providerOptions);
35+
36+
options.ConnectionString = options.Data.BuildConnectionString(new HashSet<string> { nameof(options.Provider) });
2937
}
3038
else
3139
{
3240
var redisConnectionString = config.GetConnectionString("Redis");
41+
3342
if (!String.IsNullOrEmpty(redisConnectionString))
3443
{
3544
options.Provider = "redis";
45+
options.ConnectionString = redisConnectionString;
3646
}
3747
}
3848

39-
string? providerConnectionString = !String.IsNullOrEmpty(options.Provider) ? config.GetConnectionString(options.Provider) : null;
40-
if (!String.IsNullOrEmpty(providerConnectionString))
41-
{
42-
var providerOptions = providerConnectionString.ParseConnectionString(defaultKey: "server");
43-
options.Data ??= new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
44-
options.Data.AddRange(providerOptions);
45-
}
46-
47-
options.ConnectionString = options.Data.BuildConnectionString(new HashSet<string> { nameof(options.Provider) });
48-
4949
return options;
5050
}
5151
}

src/Exceptionless.Core/Exceptionless.Core.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@
2828
<PackageReference Include="NEST.JsonNetSerializer" Version="7.17.5" />
2929
<PackageReference Include="Handlebars.Net" Version="2.1.6" />
3030
<PackageReference Include="McSherry.SemanticVersioning" Version="1.4.1" />
31-
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="9.0.2" />
32-
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="9.0.2" />
33-
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.2" />
31+
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="9.0.4" />
32+
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="9.0.4" />
33+
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.4" />
3434
<PackageReference Include="Stripe.net" Version="47.4.0" />
35-
<PackageReference Include="System.DirectoryServices" Version="9.0.2" />
35+
<PackageReference Include="System.DirectoryServices" Version="9.0.4" />
3636
<PackageReference Include="UAParser" Version="3.1.47" />
3737
<PackageReference Include="Foundatio.Repositories.Elasticsearch" Version="7.17.14" Condition="'$(ReferenceFoundatioRepositoriesSource)' == '' OR '$(ReferenceFoundatioRepositoriesSource)' == 'false'" />
3838
<ProjectReference Include="..\..\..\..\Foundatio\Foundatio.Repositories\src\Foundatio.Repositories.Elasticsearch\Foundatio.Repositories.Elasticsearch.csproj" Condition="'$(ReferenceFoundatioRepositoriesSource)' == 'true'" />

src/Exceptionless.Insulation/Bootstrapper.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ private static void RegisterCache(IServiceCollection container, CacheOptions opt
106106
{
107107
if (String.Equals(options.Provider, "redis"))
108108
{
109-
container.ReplaceSingleton(s => GetRedisConnection(options.Data, s.GetRequiredService<ILoggerFactory>()));
109+
container.ReplaceSingleton(s => GetRedisConnection(options.ConnectionString!, s.GetRequiredService<ILoggerFactory>()));
110110

111111
if (!String.IsNullOrEmpty(options.Scope))
112112
container.ReplaceSingleton<ICacheClient>(s => new ScopedCacheClient(CreateRedisCacheClient(s), options.Scope));
@@ -121,7 +121,7 @@ private static void RegisterMessageBus(IServiceCollection container, MessageBusO
121121
{
122122
if (String.Equals(options.Provider, "redis"))
123123
{
124-
container.ReplaceSingleton(s => GetRedisConnection(options.Data, s.GetRequiredService<ILoggerFactory>()));
124+
container.ReplaceSingleton(s => GetRedisConnection(options.ConnectionString!, s.GetRequiredService<ILoggerFactory>()));
125125

126126
container.ReplaceSingleton<IMessageBus>(s => new RedisMessageBus(new RedisMessageBusOptions
127127
{
@@ -145,9 +145,9 @@ private static void RegisterMessageBus(IServiceCollection container, MessageBusO
145145
}
146146
}
147147

148-
private static IConnectionMultiplexer GetRedisConnection(Dictionary<string, string> options, ILoggerFactory loggerFactory)
148+
private static IConnectionMultiplexer GetRedisConnection(string connectionString, ILoggerFactory loggerFactory)
149149
{
150-
return ConnectionMultiplexer.Connect(options.GetString("server"), o => o.LoggerFactory = loggerFactory);
150+
return ConnectionMultiplexer.Connect(connectionString, o => o.LoggerFactory = loggerFactory);
151151
}
152152

153153
private static void RegisterQueue(IServiceCollection container, QueueOptions options, bool runMaintenanceTasks)

src/Exceptionless.Insulation/Exceptionless.Insulation.csproj

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
<PackageReference Include="Foundatio.Minio" Version="11.0.8" />
99
<PackageReference Include="Foundatio.RabbitMQ" Version="11.0.8" />
1010
<PackageReference Include="Foundatio.Redis" Version="11.0.8" />
11-
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="9.0.2" />
12-
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="9.0.2" />
13-
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.2" />
14-
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="9.0.2" />
15-
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.2" />
16-
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="9.0.2" />
17-
<PackageReference Include="MailKit" Version="4.10.0" />
18-
<PackageReference Include="Serilog.Extensions.Logging" Version="9.0.0" />
11+
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="9.0.4" />
12+
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="9.0.4" />
13+
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.4" />
14+
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="9.0.4" />
15+
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.4" />
16+
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="9.0.4" />
17+
<PackageReference Include="MailKit" Version="4.11.0" />
18+
<PackageReference Include="Serilog.Extensions.Logging" Version="9.0.1" />
1919
<PackageReference Include="Serilog.Formatting.Compact" Version="3.0.0" />
2020
<PackageReference Include="Serilog.Settings.Configuration" Version="9.0.0" />
2121
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" />

src/Exceptionless.Job/Exceptionless.Job.csproj

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,27 @@
44
</ItemGroup>
55

66
<ItemGroup>
7-
<PackageReference Include="Exceptionless.AspNetCore" Version="6.0.4" />
8-
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="9.0.2" />
7+
<PackageReference Include="Exceptionless.AspNetCore" Version="6.1.0" />
8+
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="9.0.4" />
99
<PackageReference Include="App.Metrics.AspNetCore" Version="4.3.0" />
1010
<PackageReference Include="Serilog.AspNetCore" Version="9.0.0" />
1111
<PackageReference Include="Serilog.Enrichers.Span" Version="3.1.0" />
1212
<PackageReference Include="Serilog.Enrichers.Environment" Version="3.0.1" />
1313

14-
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.11.1" />
15-
<PackageReference Include="OpenTelemetry.Exporter.Console" Version="1.11.1" />
14+
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.11.2" />
15+
<PackageReference Include="OpenTelemetry.Exporter.Console" Version="1.11.2" />
1616
<PackageReference Include="OpenTelemetry.Exporter.Prometheus.AspNetCore" Version="1.10.0-beta.1" />
17-
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.11.1" />
18-
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.11.0" />
19-
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.11.0" />
17+
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.11.2" />
18+
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.11.1" />
19+
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.11.1" />
2020
<PackageReference Include="OpenTelemetry.Instrumentation.StackExchangeRedis" Version="1.10.0-beta.1" />
2121
<PackageReference Include="OpenTelemetry.Instrumentation.ElasticsearchClient" Version="1.0.0-beta.5" />
22-
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="1.11.0" />
22+
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="1.11.1" />
2323
<PackageReference Include="OpenTelemetry.Instrumentation.Process" Version="1.10.0-beta.1" />
2424
</ItemGroup>
2525

2626
<ItemGroup Label="Transitive dependency updates to resolve vulnerability warnings">
27-
<PackageReference Include="System.Text.Encodings.Web" Version="9.0.2" />
27+
<PackageReference Include="System.Text.Encodings.Web" Version="9.0.4" />
2828
</ItemGroup>
2929

3030
<ItemGroup>

0 commit comments

Comments
 (0)