Skip to content

Commit 157ea8a

Browse files
committed
Update Aspire to 8.2
1 parent f79381f commit 157ea8a

File tree

19 files changed

+124
-175
lines changed

19 files changed

+124
-175
lines changed

ReadMe.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ Reference architecture for using **Event Driven .NET** abstractions and librarie
66
- [.NET Core SDK](https://dotnet.microsoft.com/download) (8.0 or greater)
77
- [Docker Desktop](https://www.docker.com/products/docker-desktop)
88
- MongoDB Docker: `docker run --name mongo -d -p 27017:27017 -v /tmp/mongo/data:/data/db mongo`
9-
- [MongoDB Client](https://studio3t.com/download/):
10-
- Download Studio 3T only.
9+
- [MongoDB Client](https://robomongo.org/):
10+
- Download Studio 3T.
1111
- Add connection to localhost on port 27017.
1212
- [Dapr](https://dapr.io/) (Distributed Application Runtime)
1313
- [Install Dapr CLI](https://docs.dapr.io/getting-started/install-dapr-cli/)

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "8.0.100",
3+
"version": "8.0.300",
44
"rollForward": "latestPatch",
55
"allowPrerelease": true
66
}

reference-architecture/Common/Common.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99
<ItemGroup>
1010
<PackageReference Include="EventDriven.CQRS.Extensions" Version="2.0.0" />
11-
<PackageReference Include="EventDriven.EventBus.Abstractions" Version="1.4.0" />
12-
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0" />
11+
<PackageReference Include="EventDriven.EventBus.Abstractions" Version="1.5.0" />
12+
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.1" />
1313
</ItemGroup>
1414

1515
</Project>

reference-architecture/CustomerService/CustomerService.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.1" />
1212
<PackageReference Include="EventDriven.CQRS.Abstractions" Version="2.1.0" />
1313
<PackageReference Include="EventDriven.CQRS.Extensions" Version="2.0.0" />
14-
<PackageReference Include="EventDriven.DependencyInjection.URF.Mongo" Version="1.2.2" />
15-
<PackageReference Include="EventDriven.EventBus.Dapr" Version="1.4.0" />
16-
<PackageReference Include="MongoDB.Driver" Version="2.23.1" />
17-
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
18-
<PackageReference Include="URF.Core.Mongo" Version="7.0.0" />
14+
<PackageReference Include="EventDriven.DependencyInjection.URF.Mongo" Version="1.3.0" />
15+
<PackageReference Include="EventDriven.EventBus.Dapr" Version="1.6.0" />
16+
<PackageReference Include="MongoDB.Driver" Version="2.28.0" />
17+
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.7.3" />
18+
<PackageReference Include="URF.Core.Mongo" Version="8.2.28" />
1919
</ItemGroup>
2020

2121
<ItemGroup>
Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,25 @@
11
{
22
"$schema": "http://json.schemastore.org/launchsettings.json",
33
"profiles": {
4-
"CustomerService": {
4+
"https": {
55
"commandName": "Project",
66
"dotnetRunMessages": true,
77
"launchBrowser": true,
88
"launchUrl": "swagger",
9-
"applicationUrl": "http://localhost:5656",
9+
"applicationUrl": "https://localhost:5656;http://localhost:5657",
1010
"environmentVariables": {
1111
"ASPNETCORE_ENVIRONMENT": "Development"
1212
}
13+
},
14+
"specs": {
15+
"commandName": "Project",
16+
"dotnetRunMessages": true,
17+
"launchBrowser": true,
18+
"launchUrl": "swagger",
19+
"applicationUrl": "https://localhost:5656;http://localhost:5657",
20+
"environmentVariables": {
21+
"ASPNETCORE_ENVIRONMENT": "Specs"
22+
}
1323
}
1424
}
1525
}

reference-architecture/OrderService/OrderService.csproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.1" />
1212
<PackageReference Include="EventDriven.CQRS.Abstractions" Version="2.1.0" />
1313
<PackageReference Include="EventDriven.CQRS.Extensions" Version="2.0.0" />
14-
<PackageReference Include="EventDriven.DependencyInjection.URF.Mongo" Version="1.2.2" />
15-
<PackageReference Include="EventDriven.EventBus.Dapr" Version="1.4.0" />
16-
<PackageReference Include="EventDriven.EventBus.EventCache.Mongo" Version="1.4.0" />
17-
<PackageReference Include="MongoDB.Driver" Version="2.23.1" />
18-
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
19-
<PackageReference Include="URF.Core.Mongo" Version="7.0.0" />
14+
<PackageReference Include="EventDriven.DependencyInjection.URF.Mongo" Version="1.3.0" />
15+
<PackageReference Include="EventDriven.EventBus.Dapr" Version="1.6.0" />
16+
<PackageReference Include="EventDriven.EventBus.EventCache.Mongo" Version="1.6.0" />
17+
<PackageReference Include="MongoDB.Driver" Version="2.28.0" />
18+
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.7.3" />
19+
<PackageReference Include="URF.Core.Mongo" Version="8.2.28" />
2020
</ItemGroup>
2121

2222
<ItemGroup>
Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,25 @@
11
{
22
"$schema": "http://json.schemastore.org/launchsettings.json",
33
"profiles": {
4-
"OrderService": {
4+
"https": {
55
"commandName": "Project",
66
"dotnetRunMessages": true,
77
"launchBrowser": true,
88
"launchUrl": "swagger",
9-
"applicationUrl": "http://localhost:5757",
9+
"applicationUrl": "https://localhost:5757;http://localhost:5758",
1010
"environmentVariables": {
1111
"ASPNETCORE_ENVIRONMENT": "Development"
1212
}
13+
},
14+
"specs": {
15+
"commandName": "Project",
16+
"dotnetRunMessages": true,
17+
"launchBrowser": true,
18+
"launchUrl": "swagger",
19+
"applicationUrl": "https://localhost:5757;http://localhost:5758",
20+
"environmentVariables": {
21+
"ASPNETCORE_ENVIRONMENT": "Specs"
22+
}
1323
}
1424
}
1525
}

reference-architecture/ReferenceArchitecture.AppHost/Program.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
11
var builder = DistributedApplication.CreateBuilder(args);
22

3-
// TODO: Uncomment if Dapr installed on Mac with Homebrew. See https://github.com/dotnet/aspire-samples/issues/67
4-
// builder.AddDapr(configure => configure.DaprPath = "/opt/homebrew/Cellar/dapr-cli/1.12.0/bin/dapr");
5-
6-
// To set Dapr log level pass dapr options to WithDaprSidecar method instead of string app id
7-
// var customerDaprOptions = new DaprSidecarOptions { AppId = "customer-service", LogLevel = "debug", EnableApiLogging = true };
8-
// var orderDaprOptions = new DaprSidecarOptions { AppId = "order-service", LogLevel = "debug", EnableApiLogging = true };
9-
103
var pubSub = builder.AddDaprPubSub("pubsub");
114

125
builder.AddProject<Projects.CustomerService>("customer-service")

reference-architecture/ReferenceArchitecture.AppHost/Properties/launchSettings.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,28 @@
11
{
22
"$schema": "http://json.schemastore.org/launchsettings.json",
33
"profiles": {
4-
"http": {
4+
"https": {
55
"commandName": "Project",
66
"dotnetRunMessages": true,
77
"launchBrowser": true,
8-
"applicationUrl": "http://localhost:15240",
8+
"applicationUrl": "https://localhost:17098;http://localhost:15138",
99
"environmentVariables": {
1010
"ASPNETCORE_ENVIRONMENT": "Development",
1111
"DOTNET_ENVIRONMENT": "Development",
12-
"DOTNET_DASHBOARD_OTLP_ENDPOINT_URL": "http://localhost:16117"
12+
"DOTNET_DASHBOARD_OTLP_ENDPOINT_URL": "https://localhost:16117",
13+
"DOTNET_RESOURCE_SERVICE_ENDPOINT_URL": "https://localhost:16118"
1314
}
1415
},
1516
"specs": {
1617
"commandName": "Project",
1718
"dotnetRunMessages": true,
1819
"launchBrowser": true,
19-
"applicationUrl": "http://localhost:15240",
20+
"applicationUrl": "https://localhost:17098;http://localhost:15138",
2021
"environmentVariables": {
2122
"ASPNETCORE_ENVIRONMENT": "Specs",
2223
"DOTNET_ENVIRONMENT": "Specs",
23-
"DOTNET_DASHBOARD_OTLP_ENDPOINT_URL": "http://localhost:16117"
24+
"DOTNET_DASHBOARD_OTLP_ENDPOINT_URL": "https://localhost:16117",
25+
"DOTNET_RESOURCE_SERVICE_ENDPOINT_URL": "https://localhost:16118"
2426
}
2527
}
2628
}

reference-architecture/ReferenceArchitecture.AppHost/ReferenceArchitecture.AppHost.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
</PropertyGroup>
1010

1111
<ItemGroup>
12-
<PackageReference Include="Aspire.Hosting" Version="8.0.0-preview.2.23619.3" />
13-
<PackageReference Include="Aspire.Hosting.Dapr" Version="8.0.0-preview.2.23619.3" />
12+
<PackageReference Include="Aspire.Hosting.AppHost" Version="8.2.0" />
13+
<PackageReference Include="Aspire.Hosting.Dapr" Version="8.2.0" />
1414
</ItemGroup>
1515

1616
<ItemGroup>

reference-architecture/ReferenceArchitecture.ServiceDefaults/Extensions.cs

Lines changed: 38 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,16 @@
33
using Microsoft.Extensions.DependencyInjection;
44
using Microsoft.Extensions.Diagnostics.HealthChecks;
55
using Microsoft.Extensions.Logging;
6-
using OpenTelemetry.Logs;
6+
using Microsoft.Extensions.ServiceDiscovery;
7+
using OpenTelemetry;
78
using OpenTelemetry.Metrics;
89
using OpenTelemetry.Trace;
910

10-
// ReSharper disable once CheckNamespace
1111
namespace Microsoft.Extensions.Hosting;
1212

13+
// Adds common .NET Aspire services: service discovery, resilience, health checks, and OpenTelemetry.
14+
// This project should be referenced by each service project in your solution.
15+
// To learn more about using this project, see https://aka.ms/dotnet/aspire/service-defaults
1316
public static class Extensions
1417
{
1518
public static IHostApplicationBuilder AddServiceDefaults(this IHostApplicationBuilder builder)
@@ -26,9 +29,15 @@ public static IHostApplicationBuilder AddServiceDefaults(this IHostApplicationBu
2629
http.AddStandardResilienceHandler();
2730

2831
// Turn on service discovery by default
29-
http.UseServiceDiscovery();
32+
http.AddServiceDiscovery();
3033
});
3134

35+
// Uncomment the following to restrict the allowed schemes for service discovery.
36+
// builder.Services.Configure<ServiceDiscoveryOptions>(options =>
37+
// {
38+
// options.AllowedSchemes = ["https"];
39+
// });
40+
3241
return builder;
3342
}
3443

@@ -43,20 +52,16 @@ public static IHostApplicationBuilder ConfigureOpenTelemetry(this IHostApplicati
4352
builder.Services.AddOpenTelemetry()
4453
.WithMetrics(metrics =>
4554
{
46-
metrics.AddRuntimeInstrumentation()
47-
.AddBuiltInMeters();
55+
metrics.AddAspNetCoreInstrumentation()
56+
.AddHttpClientInstrumentation()
57+
.AddRuntimeInstrumentation();
4858
})
4959
.WithTracing(tracing =>
5060
{
51-
if (builder.Environment.IsDevelopment())
52-
{
53-
// We want to view all traces in development
54-
tracing.SetSampler(new AlwaysOnSampler());
55-
}
56-
5761
tracing.AddAspNetCoreInstrumentation()
58-
.AddGrpcClientInstrumentation()
59-
.AddHttpClientInstrumentation();
62+
// Uncomment the following line to enable gRPC instrumentation (requires the OpenTelemetry.Instrumentation.GrpcNetClient package)
63+
//.AddGrpcClientInstrumentation()
64+
.AddHttpClientInstrumentation();
6065
});
6166

6267
builder.AddOpenTelemetryExporters();
@@ -70,18 +75,15 @@ private static IHostApplicationBuilder AddOpenTelemetryExporters(this IHostAppli
7075

7176
if (useOtlpExporter)
7277
{
73-
builder.Services.Configure<OpenTelemetryLoggerOptions>(logging => logging.AddOtlpExporter());
74-
builder.Services.ConfigureOpenTelemetryMeterProvider(metrics => metrics.AddOtlpExporter());
75-
builder.Services.ConfigureOpenTelemetryTracerProvider(tracing => tracing.AddOtlpExporter());
78+
builder.Services.AddOpenTelemetry().UseOtlpExporter();
7679
}
7780

78-
// Uncomment the following lines to enable the Prometheus exporter (requires the OpenTelemetry.Exporter.Prometheus.AspNetCore package)
79-
// builder.Services.AddOpenTelemetry()
80-
// .WithMetrics(metrics => metrics.AddPrometheusExporter());
81-
82-
// Uncomment the following lines to enable the Azure Monitor exporter (requires the Azure.Monitor.OpenTelemetry.Exporter package)
83-
// builder.Services.AddOpenTelemetry()
84-
// .UseAzureMonitor();
81+
// Uncomment the following lines to enable the Azure Monitor exporter (requires the Azure.Monitor.OpenTelemetry.AspNetCore package)
82+
//if (!string.IsNullOrEmpty(builder.Configuration["APPLICATIONINSIGHTS_CONNECTION_STRING"]))
83+
//{
84+
// builder.Services.AddOpenTelemetry()
85+
// .UseAzureMonitor();
86+
//}
8587

8688
return builder;
8789
}
@@ -97,24 +99,20 @@ public static IHostApplicationBuilder AddDefaultHealthChecks(this IHostApplicati
9799

98100
public static WebApplication MapDefaultEndpoints(this WebApplication app)
99101
{
100-
// Uncomment the following line to enable the Prometheus endpoint (requires the OpenTelemetry.Exporter.Prometheus.AspNetCore package)
101-
// app.MapPrometheusScrapingEndpoint();
102-
103-
// All health checks must pass for app to be considered ready to accept traffic after starting
104-
app.MapHealthChecks("/health");
105-
106-
// Only health checks tagged with the "live" tag must pass for app to be considered alive
107-
app.MapHealthChecks("/alive", new HealthCheckOptions
102+
// Adding health checks endpoints to applications in non-development environments has security implications.
103+
// See https://aka.ms/dotnet/aspire/healthchecks for details before enabling these endpoints in non-development environments.
104+
if (app.Environment.IsDevelopment())
108105
{
109-
Predicate = r => r.Tags.Contains("live")
110-
});
106+
// All health checks must pass for app to be considered ready to accept traffic after starting
107+
app.MapHealthChecks("/health");
108+
109+
// Only health checks tagged with the "live" tag must pass for app to be considered alive
110+
app.MapHealthChecks("/alive", new HealthCheckOptions
111+
{
112+
Predicate = r => r.Tags.Contains("live")
113+
});
114+
}
111115

112116
return app;
113117
}
114-
115-
private static MeterProviderBuilder AddBuiltInMeters(this MeterProviderBuilder meterProviderBuilder) =>
116-
meterProviderBuilder.AddMeter(
117-
"Microsoft.AspNetCore.Hosting",
118-
"Microsoft.AspNetCore.Server.Kestrel",
119-
"System.Net.Http");
120-
}
118+
}

reference-architecture/ReferenceArchitecture.ServiceDefaults/ReferenceArchitecture.ServiceDefaults.csproj

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
<ItemGroup>
1212
<FrameworkReference Include="Microsoft.AspNetCore.App" />
1313

14-
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="8.0.0" />
15-
<PackageReference Include="Microsoft.Extensions.ServiceDiscovery" Version="8.0.0-preview.2.23619.3" />
16-
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.7.0" />
17-
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.7.0" />
18-
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.7.0" />
14+
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="8.9.1" />
15+
<PackageReference Include="Microsoft.Extensions.ServiceDiscovery" Version="8.2.0" />
16+
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.9.0" />
17+
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.9.0" />
18+
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.9.0" />
1919
<PackageReference Include="OpenTelemetry.Instrumentation.GrpcNetClient" Version="1.6.0-beta.3" />
20-
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.7.0" />
21-
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="1.5.1" />
20+
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.9.0" />
21+
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="1.9.0" />
2222
</ItemGroup>
2323

2424
</Project>

test/CustomerService.Tests/CustomerService.Tests.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99

1010
<ItemGroup>
1111
<PackageReference Include="AutoFixture" Version="4.18.1" />
12-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
13-
<PackageReference Include="Moq" Version="4.20.70" />
14-
<PackageReference Include="xunit" Version="2.6.3" />
15-
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.3">
12+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
13+
<PackageReference Include="Moq" Version="4.20.72" />
14+
<PackageReference Include="xunit" Version="2.9.0" />
15+
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
1616
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1717
<PrivateAssets>all</PrivateAssets>
1818
</PackageReference>
19-
<PackageReference Include="coverlet.collector" Version="6.0.0">
19+
<PackageReference Include="coverlet.collector" Version="6.0.2">
2020
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2121
<PrivateAssets>all</PrivateAssets>
2222
</PackageReference>

test/EventDriven.ReferenceArchitecture.Specs/Configuration/ReferenceArchSpecsSettings.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,5 @@ public class ReferenceArchSpecsSettings
1414
public Guid OrderPubSub2Id { get; set; }
1515
public string? CustomerServiceBaseAddress { get; set; }
1616
public string? OrderServiceBaseAddress { get; set; }
17-
public bool StartTyeProcess { get; set; }
18-
public TimeSpan TyeProcessTimeout { get; set; }
1917
public TimeSpan AddressUpdateTimeout { get; set; }
2018
}

test/EventDriven.ReferenceArchitecture.Specs/EventDriven.ReferenceArchitecture.Specs.csproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,19 @@
1111
</ItemGroup>
1212

1313
<ItemGroup>
14-
<PackageReference Include="EventDriven.DependencyInjection" Version="1.1.0" />
15-
<PackageReference Include="EventDriven.DependencyInjection.URF.Mongo" Version="1.2.2" />
14+
<PackageReference Include="EventDriven.DependencyInjection" Version="1.2.0" />
15+
<PackageReference Include="EventDriven.DependencyInjection.URF.Mongo" Version="1.3.0" />
1616
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="11.1.0" />
1717
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
18-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
18+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
1919
<PackageReference Include="SpecFlow.Plus.LivingDocPlugin" Version="3.9.57" />
2020
<PackageReference Include="SpecFlow.xUnit" Version="3.9.74" />
21-
<PackageReference Include="xunit" Version="2.6.3" />
22-
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.5">
21+
<PackageReference Include="xunit" Version="2.9.0" />
22+
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
2323
<PrivateAssets>all</PrivateAssets>
2424
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2525
</PackageReference>
26-
<PackageReference Include="FluentAssertions" Version="6.12.0" />
26+
<PackageReference Include="FluentAssertions" Version="6.12.1" />
2727
</ItemGroup>
2828

2929
<ItemGroup>

0 commit comments

Comments
 (0)