Skip to content

Commit f50e471

Browse files
committed
chore: updated sample to .net 9
1 parent 3e943e4 commit f50e471

163 files changed

Lines changed: 180 additions & 193 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ SOLUTION_FILE = $(ROOT_FOLDER)Purview.Telemetry.SourceGenerator.sln
66
TEST_PROJECT = $(ROOT_FOLDER)Purview.Telemetry.SourceGenerator.sln
77
CONFIGURATION = Release
88

9-
PACK_VERSION = 1.1.0
9+
PACK_VERSION = 2.0.0
1010
ARTIFACT_FOLDER = p:/sync-projects/.local-nuget/
1111

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

3+
Console.Title = "Host: Purview Telemetry Sample App";
4+
35
builder.AddProject<Projects.SampleApp_Host>("sampleapp-host");
46

57
builder.Build().Run();
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2+
<Sdk Name="Aspire.AppHost.Sdk" Version="9.0.0" />
23

34
<PropertyGroup>
45
<OutputType>Exe</OutputType>
5-
<TargetFramework>net8.0</TargetFramework>
6+
<TargetFramework>net9.0</TargetFramework>
67
<ImplicitUsings>enable</ImplicitUsings>
78
<Nullable>enable</Nullable>
89
<IsAspireHost>true</IsAspireHost>
910
</PropertyGroup>
1011

1112
<ItemGroup>
12-
<PackageReference Include="Aspire.Hosting.AppHost" Version="8.0.1" />
13+
<PackageReference Include="Aspire.Hosting.AppHost" Version="9.0.0" />
1314
</ItemGroup>
1415

1516
<ItemGroup>
1617
<ProjectReference Include="..\SampleApp.Host\SampleApp.Host.csproj" />
1718
</ItemGroup>
18-
1919
</Project>

samples/SampleApp/SampleApp.Host/SampleApp.Host.csproj

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

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net9.0</TargetFramework>
55
<Nullable>enable</Nullable>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
@@ -10,8 +10,11 @@
1010
</PropertyGroup>
1111

1212
<ItemGroup>
13-
<PackageReference Include="Purview.Telemetry.SourceGenerator" Version="1.0.11" />
14-
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.6.2" />
13+
<PackageReference Include="Purview.Telemetry.SourceGenerator" Version="2.0.0">
14+
<PrivateAssets>all</PrivateAssets>
15+
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
16+
</PackageReference>
17+
<PackageReference Include="Swashbuckle.AspNetCore" Version="7.2.0" />
1518
</ItemGroup>
1619

1720
<ItemGroup>

samples/SampleApp/SampleApp.Host/Services/IWeatherServiceTelemetry.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ public interface IWeatherServiceTelemetry
3737
[Log(LogLevel.Warning)]
3838
void TemperatureOutOfRange(int minTempInC);
3939

40-
[Log(LogLevel.Warning)]
40+
[Warning]
4141
void RequestedCountIsTooSmall(int requestCount, int validatedRequestedCount);
4242

43-
[Log]
43+
[Info]
4444
void TemperatureWithinRange();
4545

46-
[Log(LogLevel.Error)]
46+
[Error]
4747
void WeatherForecastRequestFailed(Exception ex);
4848
}
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net9.0</TargetFramework>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77
<IsAspireSharedProject>true</IsAspireSharedProject>
@@ -10,15 +10,15 @@
1010
<ItemGroup>
1111
<FrameworkReference Include="Microsoft.AspNetCore.App" />
1212

13-
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="8.5.0" />
14-
<PackageReference Include="Microsoft.Extensions.ServiceDiscovery" Version="8.0.1" />
15-
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.8.1" />
16-
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.8.1" />
17-
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.8.1" />
13+
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="9.1.0" />
14+
<PackageReference Include="Microsoft.Extensions.ServiceDiscovery" Version="9.0.0" />
15+
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.11.1" />
16+
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.11.1" />
17+
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.11.0" />
1818
<PackageReference Include="OpenTelemetry.Instrumentation.GrpcNetClient" Version="1.8.0-beta.1" />
19-
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.8.1" />
19+
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.11.0" />
2020
<PackageReference Include="OpenTelemetry.Instrumentation.Process" Version="0.5.0-beta.5" />
21-
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="1.8.1" />
21+
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="1.11.0" />
2222
</ItemGroup>
2323

2424
</Project>

src/Directory.Packages.props

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
44
<MSCodeAnalysisCSharpVersion>4.12.0</MSCodeAnalysisCSharpVersion>
55
</PropertyGroup>
6-
<ItemGroup Label="NuGet Package References" Condition="$(IsTestProject) == 'false'">
6+
<ItemGroup Label="NuGet Package References">
77
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
8-
<PackageVersion Include="Verify.XunitV3" />
9-
<PackageVersion Include="Verify.XunitV3" />
108
</ItemGroup>
119
<ItemGroup Label=".NET Packages">
1210
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="$(MSCodeAnalysisCSharpVersion)" />
@@ -30,4 +28,4 @@
3028
<PackageVersion Include="Verify.SourceGenerators" Version="2.5.0" />
3129
<PackageVersion Include="Verify.Xunitv3" Version="28.9.0" />
3230
</ItemGroup>
33-
</Project>
31+
</Project>

src/Purview.Telemetry.SourceGenerator.IntegrationTests/Snapshots/TelemetrySourceGeneratorActivityTests.Generate_GivenAssemblyEnableDI_GeneratesActivity.DotNet9_0#InfoAttribute.g.verified.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ namespace Purview.Telemetry.Logging;
1919

2020
/// <summary>
2121
/// Marker attribute used as an alternative to <see cref="LogAttribute"/>, where the <see cref="LogAttribute.Level"/>
22-
/// is set to <see cref="Microsoft.Extensions.Logging.LogLevel.Info"/>.
22+
/// is set to <see cref="Microsoft.Extensions.Logging.LogLevel.Information"/>.
2323
/// </summary>
2424
[System.AttributeUsage(System.AttributeTargets.Method, AllowMultiple = false)]
2525
[System.Diagnostics.Conditional("PURVIEW_TELEMETRY_ATTRIBUTES")]

src/Purview.Telemetry.SourceGenerator.IntegrationTests/Snapshots/TelemetrySourceGeneratorActivityTests.Generate_GivenBasicContextGenWithActivityAndNoReturn_GeneratesActivity.DotNet9_0#InfoAttribute.g.verified.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ namespace Purview.Telemetry.Logging;
1919

2020
/// <summary>
2121
/// Marker attribute used as an alternative to <see cref="LogAttribute"/>, where the <see cref="LogAttribute.Level"/>
22-
/// is set to <see cref="Microsoft.Extensions.Logging.LogLevel.Info"/>.
22+
/// is set to <see cref="Microsoft.Extensions.Logging.LogLevel.Information"/>.
2323
/// </summary>
2424
[System.AttributeUsage(System.AttributeTargets.Method, AllowMultiple = false)]
2525
[System.Diagnostics.Conditional("PURVIEW_TELEMETRY_ATTRIBUTES")]

src/Purview.Telemetry.SourceGenerator.IntegrationTests/Snapshots/TelemetrySourceGeneratorActivityTests.Generate_GivenBasicContextGenWithActivity_GeneratesActivity.DotNet9_0#InfoAttribute.g.verified.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ namespace Purview.Telemetry.Logging;
1919

2020
/// <summary>
2121
/// Marker attribute used as an alternative to <see cref="LogAttribute"/>, where the <see cref="LogAttribute.Level"/>
22-
/// is set to <see cref="Microsoft.Extensions.Logging.LogLevel.Info"/>.
22+
/// is set to <see cref="Microsoft.Extensions.Logging.LogLevel.Information"/>.
2323
/// </summary>
2424
[System.AttributeUsage(System.AttributeTargets.Method, AllowMultiple = false)]
2525
[System.Diagnostics.Conditional("PURVIEW_TELEMETRY_ATTRIBUTES")]

0 commit comments

Comments
 (0)