From 60de96aaddbeeabc1cc9c2397d8a8e4bb1aa09fc Mon Sep 17 00:00:00 2001 From: petertuton <8022856+petertuton@users.noreply.github.com> Date: Mon, 29 Nov 2021 14:21:17 -0800 Subject: [PATCH] Updated to support .NET Core 3.1 (#57) Co-authored-by: Peter Tuton --- .github/workflows/dotnet template.yml | 2 +- CHANGELOG.md | 3 +++ Microsoft.Azure.IoT.Edge.Function.nuspec | 4 ++-- README.md | 2 +- Test/Test.csproj | 9 ++++----- .../CSharp/Dockerfile.amd64 | 4 ++-- .../CSharp/Dockerfile.amd64.debug | 4 ++-- .../CSharp/Dockerfile.arm32v7 | 4 ++-- .../CSharp/Dockerfile.arm32v7.debug | 4 ++-- .../CSharp/Dockerfile.windows-amd64 | 4 ++-- .../CSharp/SampleFunction.cs | 5 ----- .../CSharp/SampleFunction.csproj | 7 ++++--- 12 files changed, 25 insertions(+), 27 deletions(-) diff --git a/.github/workflows/dotnet template.yml b/.github/workflows/dotnet template.yml index 9ce5ee6..e4cc074 100644 --- a/.github/workflows/dotnet template.yml +++ b/.github/workflows/dotnet template.yml @@ -17,7 +17,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-dotnet@v1 with: - dotnet-version: '2.1' + dotnet-version: '3.1' - run: mkdir -p .nuget - name: Download nuget run: diff --git a/CHANGELOG.md b/CHANGELOG.md index 075dc4b..ccf72fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ [![Nuget](https://img.shields.io/nuget/v/Microsoft.Azure.IoT.Edge.Function.svg)](https://www.nuget.org/packages/Microsoft.Azure.IoT.Edge.Function/) +### 3.5.3 (2021-11-12) +* [Updated] Updated to support .NET Core 3.1 + ### 3.5.2 (2021-08-23) * [Updated] Updated the nuget template json to match the schema diff --git a/Microsoft.Azure.IoT.Edge.Function.nuspec b/Microsoft.Azure.IoT.Edge.Function.nuspec index 73862bc..fccefcc 100644 --- a/Microsoft.Azure.IoT.Edge.Function.nuspec +++ b/Microsoft.Azure.IoT.Edge.Function.nuspec @@ -2,11 +2,11 @@ Microsoft.Azure.IoT.Edge.Function - 3.5.2 + 3.5.3 Azure IoT Edge Function Microsoft microsoft, nugetazureiotedge - Scaffolding tool to setup azure iot edge function development environment. + Scaffolding tool to setup Azure IoT Edge Function development environment. false en-US http://github.com/azure/dotnet-template-azure-iot-edge-function/ diff --git a/README.md b/README.md index b686372..9dccc0d 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ The template will set up all necessary files for you to focus on functionality p ## Get Started -Make sure you have [.Net Core 2.1 SDK](https://www.microsoft.com/net/download/core) installed. +Make sure you have [.Net Core 3.1 SDK](https://www.microsoft.com/net/download/core) installed. Run `dotnet` command to install the template: diff --git a/Test/Test.csproj b/Test/Test.csproj index 51034f8..e39ef8a 100644 --- a/Test/Test.csproj +++ b/Test/Test.csproj @@ -1,12 +1,11 @@ - netcoreapp2.1 + netcoreapp3.1 - - - - + + + diff --git a/content/dotnet-template-azure-iot-edge-function/CSharp/Dockerfile.amd64 b/content/dotnet-template-azure-iot-edge-function/CSharp/Dockerfile.amd64 index fea2d5e..328e130 100644 --- a/content/dotnet-template-azure-iot-edge-function/CSharp/Dockerfile.amd64 +++ b/content/dotnet-template-azure-iot-edge-function/CSharp/Dockerfile.amd64 @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/core/sdk:2.1 AS build-env +FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build-env WORKDIR /app COPY *.csproj ./ @@ -7,7 +7,7 @@ RUN dotnet restore COPY . ./ RUN dotnet publish -c Release -o out -FROM mcr.microsoft.com/azure-functions/dotnet:2.0-iot-edge +FROM mcr.microsoft.com/azure-functions/dotnet:3.0 ENV AzureWebJobsScriptRoot=/app diff --git a/content/dotnet-template-azure-iot-edge-function/CSharp/Dockerfile.amd64.debug b/content/dotnet-template-azure-iot-edge-function/CSharp/Dockerfile.amd64.debug index 46be0c1..f2282d7 100644 --- a/content/dotnet-template-azure-iot-edge-function/CSharp/Dockerfile.amd64.debug +++ b/content/dotnet-template-azure-iot-edge-function/CSharp/Dockerfile.amd64.debug @@ -1,11 +1,11 @@ -FROM mcr.microsoft.com/azure-functions/dotnet:2.0-iot-edge AS base +FROM mcr.microsoft.com/azure-functions/dotnet:3.0 AS base RUN apt-get update && \ apt-get install -y --no-install-recommends unzip procps curl && \ curl -sSL https://aka.ms/getvsdbgsh | bash /dev/stdin -v latest -l ~/vsdbg && \ rm -rf /var/lib/apt/lists/* -FROM mcr.microsoft.com/dotnet/core/sdk:2.1 AS build-env +FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build-env WORKDIR /app COPY *.csproj ./ diff --git a/content/dotnet-template-azure-iot-edge-function/CSharp/Dockerfile.arm32v7 b/content/dotnet-template-azure-iot-edge-function/CSharp/Dockerfile.arm32v7 index 22880c8..6dcb6ff 100644 --- a/content/dotnet-template-azure-iot-edge-function/CSharp/Dockerfile.arm32v7 +++ b/content/dotnet-template-azure-iot-edge-function/CSharp/Dockerfile.arm32v7 @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/core/sdk:2.1 AS build-env +FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build-env WORKDIR /app COPY *.csproj ./ @@ -7,7 +7,7 @@ RUN dotnet restore COPY . ./ RUN dotnet publish -c Release -o out -FROM mcr.microsoft.com/azure-functions/dotnet:2.0-arm32v7 +FROM mcr.microsoft.com/azure-functions/dotnet:3.0-arm32v7 ENV AzureWebJobsScriptRoot=/app diff --git a/content/dotnet-template-azure-iot-edge-function/CSharp/Dockerfile.arm32v7.debug b/content/dotnet-template-azure-iot-edge-function/CSharp/Dockerfile.arm32v7.debug index e5ed37c..0f37c71 100644 --- a/content/dotnet-template-azure-iot-edge-function/CSharp/Dockerfile.arm32v7.debug +++ b/content/dotnet-template-azure-iot-edge-function/CSharp/Dockerfile.arm32v7.debug @@ -1,11 +1,11 @@ -FROM mcr.microsoft.com/azure-functions/dotnet:2.0-arm32v7 AS base +FROM mcr.microsoft.com/azure-functions/dotnet:3.0-arm32v7 AS base RUN apt-get update && \ apt-get install -y --no-install-recommends unzip procps curl && \ curl -sSL https://aka.ms/getvsdbgsh | bash /dev/stdin -v latest -l ~/vsdbg && \ rm -rf /var/lib/apt/lists/* -FROM mcr.microsoft.com/dotnet/core/sdk:2.1 AS build-env +FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build-env WORKDIR /app COPY *.csproj ./ diff --git a/content/dotnet-template-azure-iot-edge-function/CSharp/Dockerfile.windows-amd64 b/content/dotnet-template-azure-iot-edge-function/CSharp/Dockerfile.windows-amd64 index e2ce604..b646bcc 100644 --- a/content/dotnet-template-azure-iot-edge-function/CSharp/Dockerfile.windows-amd64 +++ b/content/dotnet-template-azure-iot-edge-function/CSharp/Dockerfile.windows-amd64 @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/core/sdk:2.1 AS build-env +FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build-env WORKDIR /app COPY *.csproj ./ @@ -7,7 +7,7 @@ RUN dotnet restore COPY . ./ RUN dotnet publish -c Release -o out -FROM mcr.microsoft.com/azure-functions/dotnet:2.0-nanoserver-1809 +FROM mcr.microsoft.com/azure-functions/dotnet:3.0-nanoserver-1809 ENV AzureWebJobsScriptRoot=C:\\app diff --git a/content/dotnet-template-azure-iot-edge-function/CSharp/SampleFunction.cs b/content/dotnet-template-azure-iot-edge-function/CSharp/SampleFunction.cs index c372ef8..586e78d 100644 --- a/content/dotnet-template-azure-iot-edge-function/CSharp/SampleFunction.cs +++ b/content/dotnet-template-azure-iot-edge-function/CSharp/SampleFunction.cs @@ -1,14 +1,9 @@ -using System; using System.Collections.Generic; -using System.IO; -using System.Text; using System.Threading.Tasks; using Microsoft.Azure.Devices.Client; using Microsoft.Azure.WebJobs; using Microsoft.Azure.WebJobs.Extensions.EdgeHub; -using Microsoft.Azure.WebJobs.Host; using Microsoft.Extensions.Logging; -using Newtonsoft.Json; namespace Functions.Samples { diff --git a/content/dotnet-template-azure-iot-edge-function/CSharp/SampleFunction.csproj b/content/dotnet-template-azure-iot-edge-function/CSharp/SampleFunction.csproj index 9c2b636..5a20546 100644 --- a/content/dotnet-template-azure-iot-edge-function/CSharp/SampleFunction.csproj +++ b/content/dotnet-template-azure-iot-edge-function/CSharp/SampleFunction.csproj @@ -3,15 +3,16 @@ netstandard2.0 - + True - - + + +