Skip to content

Commit c804aa7

Browse files
Update to .NET9 (#716)
## Description Updated Web app to dot net 9, plus fixed import maps as they weren't importing for some reason. Found a [SO post](https://stackoverflow.com/questions/79279047/why-does-asp-net-core-9-strip-out-importmap) on how dot net 9 strips them out for some reason. --------- Co-authored-by: Benjamin Michaelis <[email protected]> Co-authored-by: Benjamin Michaelis <[email protected]>
1 parent 1d82722 commit c804aa7

File tree

7 files changed

+25
-24
lines changed

7 files changed

+25
-24
lines changed

.github/workflows/Build-Test-And-Deploy.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ jobs:
1313
build-and-test:
1414
runs-on: ubuntu-latest
1515
environment: "BuildAndUploadImage"
16-
env:
17-
TEST_TAG: user/app:test
1816

1917
steps:
2018
- uses: actions/checkout@v4

Directory.Packages.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
<PackageVersion Include="ContentFeedNuget" Version="$(ToolingPackagesVersion)" />
1717
</ItemGroup>
1818
<ItemGroup>
19+
<PackageVersion Include="Microsoft.AspNetCore.Components" Version="9.0.1" />
1920
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.8.0" />
2021
<PackageVersion Include="Microsoft.CodeAnalysis.Common" Version="4.8.0" />
2122
<PackageVersion Include="EssentialCSharp.Shared.Models" Version="$(ToolingPackagesVersion)" />

EssentialCSharp.Web.Tests/EssentialCSharp.Web.Tests.csproj

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

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net9.0</TargetFramework>
55

66
<IsPackable>false</IsPackable>
77
<IsPublishable>false</IsPublishable>

EssentialCSharp.Web/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#syntax=docker/dockerfile:1.2
22

3-
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
3+
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base
44
WORKDIR /app
55
EXPOSE 8080
66
EXPOSE 8081
77

8-
FROM mcr.microsoft.com/dotnet/sdk:8.0.101 AS build
8+
FROM mcr.microsoft.com/dotnet/sdk:9.0.200 AS build
99
ARG ACCESS_TO_NUGET_FEED=true
1010
ENV ACCESS_TO_NUGET_FEED=$ACCESS_TO_NUGET_FEED
1111
RUN sh -c "$(curl -fsSL https://aka.ms/install-artifacts-credprovider.sh)"

EssentialCSharp.Web/EssentialCSharp.Web.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22
<PropertyGroup>
3-
<TargetFramework>net8.0</TargetFramework>
3+
<TargetFramework>net9.0</TargetFramework>
44
</PropertyGroup>
55
<ItemGroup>
66
<PlaceholderChapterOneHtmlFile Include="$(ProjectDir)/Placeholders/Chapters/01/Pages/*.html" />
@@ -20,6 +20,7 @@
2020
<PackageReference Include="IntelliTect.Multitool" />
2121
<PackageReference Include="Mailjet.Api" />
2222
<PackageReference Include="Microsoft.AspNetCore.Authentication.MicrosoftAccount" />
23+
<PackageReference Include="Microsoft.AspNetCore.Components" />
2324
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" />
2425
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" />
2526
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" />

EssentialCSharp.Web/Views/Shared/_Layout.cshtml

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,21 @@
44
@using IntelliTect.Multitool
55
@using EssentialCSharp.Common
66
@inject ISiteMappingService _SiteMappings
7+
@using Microsoft.AspNetCore.Components
8+
@{
9+
var prodMap = new ImportMapDefinition(
10+
new Dictionary<string, string>
11+
{
12+
{ "vue", "./lib/vue/dist/vue.esm-browser.prod.js" },
13+
{ "vue-window-size", "./lib/vue-window-size/composition-api/dist/index.js" },
14+
}, null, null);
15+
var devMap = new ImportMapDefinition(
16+
new Dictionary<string, string>
17+
{
18+
{ "vue", "./lib/vue/dist/vue.esm-browser.js" },
19+
{ "vue-window-size", "./lib/vue-window-size/composition-api/dist/index.js" },
20+
}, null, null);
21+
}
722
<!DOCTYPE html>
823
<html lang="en">
924
<head>
@@ -46,24 +61,10 @@
4661
@*So that Safari can import modules*@
4762
<script async src="/lib/es-module-shims/dist/es-module-shims.js"></script>
4863
<environment include="Development">
49-
<script type="importmap">
50-
{
51-
"imports": {
52-
"vue": "./lib/vue/dist/vue.esm-browser.js",
53-
"vue-window-size": "./lib/vue-window-size/composition-api/dist/index.js"
54-
}
55-
}
56-
</script>
64+
<script type="importmap" asp-importmap="@devMap"></script>
5765
</environment>
5866
<environment exclude="Development">
59-
<script type="importmap">
60-
{
61-
"imports": {
62-
"vue": "./lib/vue/dist/vue.esm-browser.prod.js",
63-
"vue-window-size": "./lib/vue-window-size/composition-api/dist/index.js"
64-
}
65-
}
66-
</script>
67+
<script type="importmap" asp-importmap="@prodMap"></script>
6768
</environment>
6869
<script type="text/javascript">
6970
(function (c, l, a, r, i, t, y) {

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "8.0.100",
3+
"version": "9.0.101",
44
"rollForward": "latestMinor"
55
}
66
}

0 commit comments

Comments
 (0)