Skip to content

Commit

Permalink
Update to .NET 7
Browse files Browse the repository at this point in the history
  • Loading branch information
Seji64 committed Apr 6, 2023
1 parent fd0aba6 commit 1ed0f11
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 22 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ jobs:
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'
dotnet-version: '7.0.x'

- name: Build
shell: bash
run: |
tag=$(git describe --tags --abbrev=0)
release_name="LAPS-WebUI-$tag-${{ matrix.target }}"
# Build everything
dotnet publish src/LAPS-WebUI.csproj --self-contained --framework net6.0 --runtime "${{ matrix.target }}" -c Release -o "$release_name"
dotnet publish src/LAPS-WebUI.csproj --self-contained --framework net7.0 --runtime "${{ matrix.target }}" -c Release -o "$release_name"
# Pack files
if [ "${{ matrix.target }}" == "win-x64" ]; then
# Pack to zip for Windows
Expand Down
4 changes: 2 additions & 2 deletions src/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
WORKDIR /src
COPY ["LAPS-WebUI.csproj", "."]
RUN dotnet restore "./LAPS-WebUI.csproj"
Expand Down
14 changes: 7 additions & 7 deletions src/LAPS-WebUI.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>LAPS_WebUI</RootNamespace>
Expand All @@ -11,15 +11,15 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Blazored.SessionStorage" Version="2.2.0" />
<PackageReference Include="CurrieTechnologies.Razor.Clipboard" Version="1.4.0" />
<PackageReference Include="Blazored.SessionStorage" Version="2.3.0" />
<PackageReference Include="CurrieTechnologies.Razor.Clipboard" Version="1.6.0" />
<PackageReference Include="LdapForNet" Version="2.7.15" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection" Version="7.0.0" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.17.0" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection" Version="7.0.4" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.18.1" />
<PackageReference Include="Microsoft.Web.LibraryManager.Build" Version="2.1.175" />
<PackageReference Include="MudBlazor" Version="6.1.2" />
<PackageReference Include="MudBlazor" Version="6.2.0" />
<PackageReference Include="Serilog" Version="2.12.0" />
<PackageReference Include="Serilog.AspNetCore" Version="6.0.1" />
<PackageReference Include="Serilog.AspNetCore" Version="6.1.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="4.1.0" />
</ItemGroup>

Expand Down
7 changes: 1 addition & 6 deletions src/Models/LDAPOptions.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace LAPS_WebUI.Models
namespace LAPS_WebUI.Models
{
public class LDAPOptions
{
Expand Down
3 changes: 1 addition & 2 deletions src/Models/UserLoginRequest.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations;

namespace LAPS_WebUI.Models
{
Expand Down
6 changes: 3 additions & 3 deletions src/Services/LDAPService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public LDAPService(IOptions<LDAPOptions> ldapoptions)
}
catch (Exception ex)
{
Log.Error(ex.Message);
Log.Error("{ErrorMessage}",ex.Message);
return null;
}

Expand Down Expand Up @@ -114,7 +114,7 @@ public async Task<bool> TestCredentialsAsync(LdapCredential ldapCredential)

public async Task<List<ADComputer>> SearchADComputersAsync(LdapCredential ldapCredential, string query)
{
List<ADComputer> result = new List<ADComputer>();
List<ADComputer> result = new();

if (ldapCredential is null)
{
Expand Down Expand Up @@ -143,7 +143,7 @@ public async Task<List<ADComputer>> SearchADComputersAsync(LdapCredential ldapCr
}
catch (Exception ex)
{
Log.Error(ex.Message);
Log.Error("{ErrorMessage}", ex.Message);
}
}
return result;
Expand Down

0 comments on commit 1ed0f11

Please sign in to comment.