From 8b8d3dc5d845ba55fc0f22d6697b8da92d38e251 Mon Sep 17 00:00:00 2001 From: Chris Kaczor Date: Tue, 30 Jul 2019 14:08:13 -0400 Subject: [PATCH] Update to .NET Core 3.0 --- Weather/Service/Dockerfile | 4 ++-- Weather/Service/Service.csproj | 3 +-- Weather/Service/Startup.cs | 11 +++++------ 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/Weather/Service/Dockerfile b/Weather/Service/Dockerfile index 583167e..d1de8a5 100644 --- a/Weather/Service/Dockerfile +++ b/Weather/Service/Dockerfile @@ -1,8 +1,8 @@ -FROM microsoft/dotnet:2.2-aspnetcore-runtime-stretch-slim AS base +FROM mcr.microsoft.com/dotnet/core/aspnet:3.0.0-preview7-buster-slim-arm32v7 AS base WORKDIR /app EXPOSE 80 -FROM microsoft/dotnet:2.2-sdk-stretch AS build +FROM mcr.microsoft.com/dotnet/core/sdk:3.0.100-preview7-buster AS build WORKDIR /src COPY ["./Service.csproj", "./"] RUN dotnet restore "Service.csproj" diff --git a/Weather/Service/Service.csproj b/Weather/Service/Service.csproj index fa95849..2c0e265 100644 --- a/Weather/Service/Service.csproj +++ b/Weather/Service/Service.csproj @@ -2,7 +2,7 @@ true - netcoreapp2.2 + netcoreapp3.0 InProcess ChrisKaczor.HomeMonitor.Weather.Service ChrisKaczor.HomeMonitor.Weather.Service @@ -21,7 +21,6 @@ - diff --git a/Weather/Service/Startup.cs b/Weather/Service/Startup.cs index cb8283a..a0829c4 100644 --- a/Weather/Service/Startup.cs +++ b/Weather/Service/Startup.cs @@ -1,8 +1,9 @@ -using Microsoft.AspNetCore.Builder; +using ChrisKaczor.HomeMonitor.Weather.Service.Data; +using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.DependencyInjection; -using ChrisKaczor.HomeMonitor.Weather.Service.Data; +using Microsoft.Extensions.Hosting; namespace ChrisKaczor.HomeMonitor.Weather.Service { @@ -14,18 +15,16 @@ namespace ChrisKaczor.HomeMonitor.Weather.Service services.AddHostedService(); - services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2); + services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_3_0); } - public void Configure(IApplicationBuilder applicationBuilder, IHostingEnvironment environment) + public void Configure(IApplicationBuilder applicationBuilder, IWebHostEnvironment environment) { if (environment.IsDevelopment()) applicationBuilder.UseDeveloperExceptionPage(); var database = applicationBuilder.ApplicationServices.GetService(); database.EnsureDatabase(); - - applicationBuilder.UseMvc(); } } } \ No newline at end of file