Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update examples to .NET 9 #71

Merged
merged 8 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ jobs:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Setup .NET 9 Preview
uses: actions/setup-dotnet@6bd8b7f7774af54e05809fcc5431931b3eb1ddee # v4.0.1
with:
dotnet-version: '9.0.x'
dotnet-quality: 'preview'

- name: Build
run: |
dotnet build
7 changes: 7 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ jobs:
with:
fetch-depth: 0

- name: Setup .NET 9 Preview
uses: actions/setup-dotnet@6bd8b7f7774af54e05809fcc5431931b3eb1ddee # v4.0.1
with:
dotnet-version: '9.0.x'
dotnet-quality: 'preview'


- name: Initialize CodeQL
uses: github/codeql-action/init@662472033e021d55d94146f66f6058822b0b39fd # v3.27.0
with:
Expand Down
29 changes: 29 additions & 0 deletions NewRelicDotNetExamples.sln
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,28 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sender", "custom-distribute
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Receiver", "custom-distributed-tracing\Receiver\Receiver.csproj", "{C7A586C3-C0BD-4D6F-B9CE-66374900CF50}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ignore-errors", "ignore-errors\ignore-errors.csproj", "{FDDF014F-E5C9-46BB-A15D-9872CB066672}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ignore-errors", "ignore-errors", "{DB522736-B3FD-4F75-B5EB-3F39AC05BE2A}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "kubernetes", "kubernetes", "{0895F1A7-450D-4AD7-80FA-1A3A81769DAC}"
ProjectSection(SolutionItems) = preProject
kubernetes\Dockerfile = kubernetes\Dockerfile
kubernetes\README.md = kubernetes\README.md
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Chart", "Chart", "{B0504510-9D75-4924-B97F-10561966615E}"
ProjectSection(SolutionItems) = preProject
kubernetes\chart\.helmignore = kubernetes\chart\.helmignore
kubernetes\chart\Chart.yaml = kubernetes\chart\Chart.yaml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "templates", "templates", "{9F64C6D3-673E-4EF0-9DCB-BF73864DEF9E}"
ProjectSection(SolutionItems) = preProject
kubernetes\chart\templates\deployment.yaml = kubernetes\chart\templates\deployment.yaml
kubernetes\chart\templates\instrumentation.yaml = kubernetes\chart\templates\instrumentation.yaml
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -116,6 +138,10 @@ Global
{C7A586C3-C0BD-4D6F-B9CE-66374900CF50}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C7A586C3-C0BD-4D6F-B9CE-66374900CF50}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C7A586C3-C0BD-4D6F-B9CE-66374900CF50}.Release|Any CPU.Build.0 = Release|Any CPU
{FDDF014F-E5C9-46BB-A15D-9872CB066672}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FDDF014F-E5C9-46BB-A15D-9872CB066672}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FDDF014F-E5C9-46BB-A15D-9872CB066672}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FDDF014F-E5C9-46BB-A15D-9872CB066672}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -138,6 +164,9 @@ Global
{28F7EABE-3B09-4098-9DA8-028E9EF776DE} = {5E23846E-C310-412F-81FB-477254B68FFA}
{DDA626A8-8450-4E0C-91B2-85BA66D5CE7E} = {74106E49-BF72-4BD6-B12C-EFC148C90F80}
{C7A586C3-C0BD-4D6F-B9CE-66374900CF50} = {74106E49-BF72-4BD6-B12C-EFC148C90F80}
{FDDF014F-E5C9-46BB-A15D-9872CB066672} = {DB522736-B3FD-4F75-B5EB-3F39AC05BE2A}
{B0504510-9D75-4924-B97F-10561966615E} = {0895F1A7-450D-4AD7-80FA-1A3A81769DAC}
{9F64C6D3-673E-4EF0-9DCB-BF73864DEF9E} = {B0504510-9D75-4924-B97F-10561966615E}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {974824D6-453F-4962-AF8A-31949A0F847E}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<a href="https://opensource.newrelic.com/oss-category/#example-code"><picture><source media="(prefers-color-scheme: dark)" srcset="https://github.com/newrelic/opensource-website/raw/main/src/images/categories/dark/Example_Code.png"><source media="(prefers-color-scheme: light)" srcset="https://github.com/newrelic/opensource-website/raw/main/src/images/categories/Example_Code.png"><img alt="New Relic Open Source example project banner." src="https://github.com/newrelic/opensource-website/raw/main/src/images/categories/Example_Code.png"></picture></a>

# New Relic .Net Agent Code Samples
# New Relic .NET Agent Code Samples

A collection of code samples that demonstrate various methods of installing and using the New Relic .NET agent.

Expand Down
8 changes: 4 additions & 4 deletions console/ConsoleSample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<LangVersion>default</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.2" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.0" />
<!--
Use the latest version of the NewRelic.Agent package.
NOTE: For a production app, you should always reference a specific package version
Expand Down
6 changes: 3 additions & 3 deletions console/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# New Relic .NET Agent Sample - Console (.NET 8)
# New Relic .NET Agent Sample - Console (.NET 9)

## Overview
This sample demonstrates a .NET 8 Console app, using the `NewRelic.Agent` [NuGet package](https://www.nuget.org/packages/NewRelic.Agent). The application runs a `BackgroundService` that requests the current weather for Portland, OR (using a free api service) every 5 seconds and writes the JSON response to the console.
This sample demonstrates a .NET 9 Console app, using the `NewRelic.Agent` [NuGet package](https://www.nuget.org/packages/NewRelic.Agent). The application runs a `BackgroundService` that requests the current weather for Portland, OR (using a free api service) every 5 seconds and writes the JSON response to the console.

## To run this sample:
1. Edit `runSample.ps1` and replace `<your-new-relic-license-key>` with your New Relic license key.
Expand All @@ -10,7 +10,7 @@ This sample demonstrates a .NET 8 Console app, using the `NewRelic.Agent` [NuGet
.\runSample.ps1
```
3. Log in to your New Relic account and look for the `ConsoleSample` app on the APM Summary page (it can take a few minutes).
4. You can view the logs generated by the New Relic .NET Agent by navigating to the `bin\debug\net8.0\newrelic\logs` folder.
4. You can view the logs generated by the New Relic .NET Agent by navigating to the `bin\debug\net9.0\newrelic\logs` folder.

## For more help
Refer to the [.NET Agent Documentation](https://docs.newrelic.com/install/dotnet) if you need further guidance.
6 changes: 3 additions & 3 deletions console/runSample.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
# set the required environment variables for the .NET Agent
$env:CORECLR_ENABLE_PROFILING=1
$env:CORECLR_PROFILER="{36032161-FFC0-4B61-B559-F6C5D41BAE5A}"
$env:CORECLR_PROFILER_PATH="$PWD\bin\release\net8.0\newrelic\NewRelic.Profiler.dll"
$env:CORECLR_NEWRELIC_HOME="$PWD\bin\release\net8.0\newrelic"
$env:CORECLR_PROFILER_PATH="$PWD\bin\release\net9.0\newrelic\NewRelic.Profiler.dll"
$env:CORECLR_NEWRELIC_HOME="$PWD\bin\release\net9.0\newrelic"
$env:NEW_RELIC_LICENSE_KEY="<your-new-relic-license-key>" # *** Replace with your license key! ***
$env:NEW_RELIC_APP_NAME="ConsoleSample"

# run the sample
dotnet run -c Release
dotnet run -c Release
4 changes: 2 additions & 2 deletions custom-distributed-tracing/Receiver/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM mcr.microsoft.com/dotnet/runtime:8.0 AS base
FROM mcr.microsoft.com/dotnet/runtime:9.0 AS base
WORKDIR /app
EXPOSE 80

FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
WORKDIR /src

COPY . ./Receiver
Expand Down
5 changes: 4 additions & 1 deletion custom-distributed-tracing/Receiver/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using Azure.Messaging.ServiceBus;
// Copyright 2023 New Relic, Inc. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

using Azure.Messaging.ServiceBus;
using NewRelic.Api.Agent;

Console.WriteLine("Hello from Reciever");
Expand Down Expand Up @@ -53,12 +56,12 @@
return data;
}
object value;
if (applicationProperties.TryGetValue(key, out value))

Check warning on line 59 in custom-distributed-tracing/Receiver/Program.cs

View workflow job for this annotation

GitHub Actions / Analyze .NET Samples Solution

Converting null literal or possible null value to non-nullable type.

Check warning on line 59 in custom-distributed-tracing/Receiver/Program.cs

View workflow job for this annotation

GitHub Actions / Analyze .NET Samples Solution

Converting null literal or possible null value to non-nullable type.

Check warning on line 59 in custom-distributed-tracing/Receiver/Program.cs

View workflow job for this annotation

GitHub Actions / build

Converting null literal or possible null value to non-nullable type.

Check warning on line 59 in custom-distributed-tracing/Receiver/Program.cs

View workflow job for this annotation

GitHub Actions / build

Converting null literal or possible null value to non-nullable type.
{
if (value != null)
{
Console.WriteLine($"key=value: {key} = {value}");
data.Add(value.ToString());

Check warning on line 64 in custom-distributed-tracing/Receiver/Program.cs

View workflow job for this annotation

GitHub Actions / Analyze .NET Samples Solution

Possible null reference argument for parameter 'item' in 'void List<string>.Add(string item)'.

Check warning on line 64 in custom-distributed-tracing/Receiver/Program.cs

View workflow job for this annotation

GitHub Actions / Analyze .NET Samples Solution

Possible null reference argument for parameter 'item' in 'void List<string>.Add(string item)'.

Check warning on line 64 in custom-distributed-tracing/Receiver/Program.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference argument for parameter 'item' in 'void List<string>.Add(string item)'.

Check warning on line 64 in custom-distributed-tracing/Receiver/Program.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference argument for parameter 'item' in 'void List<string>.Add(string item)'.
}
}
return data;
Expand Down
5 changes: 3 additions & 2 deletions custom-distributed-tracing/Receiver/Receiver.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand All @@ -11,6 +11,7 @@
<PackageReference Include="Azure.Messaging.ServiceBus" Version="7.18.2" />
<PackageReference Include="NewRelic.Agent" Version="10.33.1" />
<PackageReference Include="NewRelic.Agent.Api" Version="10.33.1" />
<PackageReference Include="System.Text.Json" Version="9.0.0" />
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions custom-distributed-tracing/Sender/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM mcr.microsoft.com/dotnet/runtime:8.0 AS base
FROM mcr.microsoft.com/dotnet/runtime:9.0 AS base
WORKDIR /app
EXPOSE 80

FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
WORKDIR /src

COPY . ./Sender
Expand Down
5 changes: 4 additions & 1 deletion custom-distributed-tracing/Sender/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using Azure.Messaging.ServiceBus;
// Copyright 2023 New Relic, Inc. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

using Azure.Messaging.ServiceBus;
using NewRelic.Api.Agent;

Console.WriteLine("Hello from Sender");
Expand Down
5 changes: 3 additions & 2 deletions custom-distributed-tracing/Sender/Sender.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand All @@ -11,6 +11,7 @@
<PackageReference Include="Azure.Messaging.ServiceBus" Version="7.18.2" />
<PackageReference Include="NewRelic.Agent" Version="10.33.1" />
<PackageReference Include="NewRelic.Agent.Api" Version="10.33.1" />
<PackageReference Include="System.Text.Json" Version="9.0.0" />
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions docker-agent-installed/alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine AS base
FROM mcr.microsoft.com/dotnet/aspnet:9.0-alpine AS base
WORKDIR /app
EXPOSE 80
ENV ASPNETCORE_URLS=http://+:80

FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build
FROM mcr.microsoft.com/dotnet/sdk:9.0-alpine AS build

WORKDIR /src
COPY . ./
Expand Down
2 changes: 1 addition & 1 deletion docker-agent-installed/alpine/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# New Relic .NET Agent Sample - Docker (Alpine)

## Overview
This sample demonstrates running a .NET 8 Web API in an Alpine-based Docker container, with New Relic .NET Agent instrumentation.
This sample demonstrates running a .NET 9 Web API in an Alpine-based Docker container, with New Relic .NET Agent instrumentation.
The sample application is just the "default" application created by running `dotnet new webapi`.

The two important parts of this sample are installation of the New Relic .NET Agent and setting the required environment variables to enable the .NET Agent
Expand Down
6 changes: 3 additions & 3 deletions docker-agent-installed/alpine/WeatherForecast.csproj
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<LangVersion>default</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.10" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.9.0" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="7.0.0" />
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions docker-agent-installed/centos/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ EXPOSE 80
ENV ASPNETCORE_URLS=http://+:80

# build using the Debian-based .NET SDK image
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build

WORKDIR /src
COPY . ./
Expand All @@ -14,7 +14,7 @@ RUN dotnet publish -c Release -o /app/publish
FROM base AS final

# install asp.netcore
RUN dnf install aspnetcore-runtime-8.0 -y
RUN dnf install aspnetcore-runtime-9.0 -y

# install wget
RUN yum -y update && yum -y install wget
Expand Down
2 changes: 1 addition & 1 deletion docker-agent-installed/centos/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Overview

This sample demonstrates running a .NET 8 Web API in a Centos-based Docker container, with New Relic .NET Agent instrumentation. The sample application is just the "default" application created
This sample demonstrates running a .NET 9 Web API in a Centos-based Docker container, with New Relic .NET Agent instrumentation. The sample application is just the "default" application created
by running `dotnet new webapi`.

The two important parts of this sample are installation of the New Relic .NET Agent and setting the required environment variables to enable the .NET Agent
Expand Down
6 changes: 3 additions & 3 deletions docker-agent-installed/centos/WeatherForecast.csproj
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<LangVersion>default</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.10" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.9.0" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="7.0.0" />
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions docker-agent-installed/ubuntu/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM mcr.microsoft.com/dotnet/aspnet:8.0-noble AS base
FROM mcr.microsoft.com/dotnet/aspnet:9.0-noble AS base
WORKDIR /app
EXPOSE 80
ENV ASPNETCORE_URLS=http://+:80

FROM mcr.microsoft.com/dotnet/sdk:8.0-noble AS build
FROM mcr.microsoft.com/dotnet/sdk:9.0-noble AS build

WORKDIR /src
COPY . ./
Expand Down
4 changes: 2 additions & 2 deletions docker-agent-installed/ubuntu/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

## Overview

This sample demonstrates running a .NET 8 Web API in a Ubuntu-based Docker container, with New Relic .NET Agent instrumentation. The sample application is just the "default" application created
This sample demonstrates running a .NET 9 Web API in a Ubuntu-based Docker container, with New Relic .NET Agent instrumentation. The sample application is just the "default" application created
by running `dotnet new webapi`.

The two important parts of this sample are installation of the New Relic .NET Agent and setting the required environment variables to enable the .NET Agent
to load and instrument the sample app. Refer to `Dockerfile` for details.

Note that this sample uses a Ubuntu-based Docker image; you could use a Debian-based image also, by changing the tag on the two `FROM` lines in
`Dockerfile` to reference `8.0` (or `8.0-bookworm-slim`). No other changes required are required.
`Dockerfile` to reference `9.0` (or `9.0-bookworm-slim`). No other changes required are required.

## To run this sample:
1. Edit `Dockerfile` and replace `<your-new-relic-license-key>` with your New Relic license key.
Expand Down
6 changes: 3 additions & 3 deletions docker-agent-installed/ubuntu/WeatherForecast.csproj
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<LangVersion>default</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.10" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.9.0" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="7.0.0" />
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions docker-agent-nuget/alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine AS base
FROM mcr.microsoft.com/dotnet/aspnet:9.0-alpine AS base
WORKDIR /app
EXPOSE 80
ENV ASPNETCORE_URLS=http://+:80

FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build
FROM mcr.microsoft.com/dotnet/sdk:9.0-alpine AS build

WORKDIR /src
COPY . ./
Expand Down
2 changes: 1 addition & 1 deletion docker-agent-nuget/alpine/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Overview

This sample demonstrates running a .NET 8 Web API in an Alpine-based Docker container with New Relic .NET Agent instrumentation via NuGet packages.
This sample demonstrates running a .NET 9 Web API in an Alpine-based Docker container with New Relic .NET Agent instrumentation via NuGet packages.

The sample application is just the "default" application created by running `dotnet new webapi`.

Expand Down
6 changes: 3 additions & 3 deletions docker-agent-nuget/alpine/WeatherForecast.csproj
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<LangVersion>default</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.10" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.9.0" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="7.0.0" />
<!--
Use the latest version of the NewRelic.Agent package.
NOTE: For a production app, you should always reference a specific package version
Expand Down
Loading
Loading