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: Upgrade from .NET Core 2.1 to .NET Core 3.1 (#1112) #1110

Closed
wants to merge 6 commits into from
Closed
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
16 changes: 4 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
FROM mono:latest
FROM mcr.microsoft.com/dotnet/sdk:3.1

ENV FrameworkPathOverride /usr/lib/mono/4.5/

RUN apt-get update \
&& apt-get install -y curl make apt-transport-https

RUN curl -sSL https://packages.microsoft.com/config/ubuntu/19.10/packages-microsoft-prod.deb -o packages-microsoft-prod.deb \
&& dpkg --install packages-microsoft-prod.deb
COPY prism/prism/nginx/cert.crt /usr/local/share/ca-certificates/cert.crt

RUN apt-get update \
&& apt-get install -y dotnet-sdk-2.1

COPY prism/prism/nginx/cert.crt /usr/local/share/ca-certificates/cert.crt
RUN update-ca-certificates
&& apt-get install -y make apt-transport-https \
&& update-ca-certificates

COPY . .

Expand Down
6 changes: 2 additions & 4 deletions ExampleCoreProject/ExampleCoreProject.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
<OutputType>Exe</OutputType>
<IsPackable>false</IsPackable>
</PropertyGroup>
Expand All @@ -16,9 +16,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="3.1.4" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.4" />
<PackageReference Include="Microsoft.Extensions.Http" Version="3.1.4" />
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion ExampleNet45Project/ExampleNet45.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="1.1.2" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="1.1.2" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="All" Condition=" '$(OS)' != 'Windows_NT' " />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.2" PrivateAssets="All" Condition=" '$(OS)' != 'Windows_NT' " />
</ItemGroup>

<ItemGroup>
Expand Down
24 changes: 12 additions & 12 deletions examples/eventwebhook/consumer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
FROM microsoft/dotnet:2.1-sdk AS build
WORKDIR /App
FROM mcr.microsoft.com/dotnet/sdk:3.1 AS build
WORKDIR /app

# copy csproj and restore as distinct layers
COPY *.sln .
COPY Src/EventWebhook/*.csproj ./Src/EventWebhook/
COPY Tests/EventWebhook.Tests/*.csproj ./Tests/EventWebhook.Tests/
COPY src/EventWebhook/*.csproj ./src/EventWebhook/
COPY tests/EventWebhook.Tests/*.csproj ./tests/EventWebhook.Tests/
RUN dotnet restore

# copy everything else and build app
COPY Src/EventWebhook/. ./Src/EventWebhook/
WORKDIR /App/Src/EventWebhook
RUN dotnet publish -c Release -o Out
COPY src/EventWebhook/. ./src/EventWebhook/
WORKDIR /app/src/EventWebhook
RUN dotnet publish -c Release -o out

FROM microsoft/dotnet:2.1-aspnetcore-runtime AS runtime
WORKDIR /App
COPY --from=build /App/Src/EventWebhook/Out ./
FROM mcr.microsoft.com/dotnet/aspnet:3.1 AS runtime
WORKDIR /app
COPY --from=build /app/src/EventWebhook/out ./

RUN echo "ASPNETCORE_URLS=http://0.0.0.0:\$PORT\nDOTNET_RUNNING_IN_CONTAINER=true" > /App/SetupHerokuEnv.sh && chmod +x /App/SetupHerokuEnv.sh
RUN echo "ASPNETCORE_URLS=http://0.0.0.0:\$PORT\nDOTNET_RUNNING_IN_CONTAINER=true" > /app/SetupHerokuEnv.sh && chmod +x /app/SetupHerokuEnv.sh

CMD /bin/bash -c "source /App/SetupHerokuEnv.sh && dotnet EventWebhook.dll"
CMD /bin/bash -c "source /app/SetupHerokuEnv.sh && dotnet EventWebhook.dll"
2 changes: 1 addition & 1 deletion examples/eventwebhook/consumer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ cd sendgrid-csharp/examples/eventwebhook/consumer

dotnet restore

dotnet run --project .\Src\EventWebhook\EventWebhook.csproj
dotnet run --project .\src\EventWebhook\EventWebhook.csproj
```
Above will start server listening on a random port like below

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26124.0
MinimumVisualStudioVersion = 15.0.26124.0
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Src", "Src", "{B08185CF-3F2E-4638-877B-587F5F60CA74}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{B08185CF-3F2E-4638-877B-587F5F60CA74}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EventWebhook", "Src\EventWebhook\EventWebhook.csproj", "{3897C29A-AE26-4FE5-8421-71896EC935C5}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EventWebhook", "src\EventWebhook\EventWebhook.csproj", "{3897C29A-AE26-4FE5-8421-71896EC935C5}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{81CAC535-9854-47AD-9D3E-385AC2668C35}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{81CAC535-9854-47AD-9D3E-385AC2668C35}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EventWebhook.Tests", "Tests\EventWebhook.Tests\EventWebhook.Tests.csproj", "{5C6AA0EB-57B7-4E76-804A-70F7A7DF4FC0}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EventWebhook.Tests", "tests\EventWebhook.Tests\EventWebhook.Tests.csproj", "{5C6AA0EB-57B7-4E76-804A-70F7A7DF4FC0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

19 changes: 0 additions & 19 deletions examples/eventwebhook/consumer/Src/EventWebhook/Models/Category.cs

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading