Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## General

- Make only high confidence suggestions when reviewing code changes.
- Always use the latest version C#, currently C# 13 features.
- Always use the latest version C#, currently C# 14 features.
- Write code that is clean, maintainable, and easy to understand.
- Only add comments rarely to explain why a non-intuitive solution was used. The code should be self-explanatory otherwise.
- Don't add the UTF-8 BOM to files unless they have non-ASCII characters.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
env:
AZURE_WEBAPP_NAME: pdfsmith
AZURE_WEBAPP_PACKAGE_PATH: './published'
NET_VERSION: '9.x'
NET_VERSION: '10.x'
PROJECT_NAME: src/PdfSmith
RUNTIME: linux-x64

Expand Down
12 changes: 6 additions & 6 deletions src/PdfSmith.BusinessLayer/PdfSmith.BusinessLayer.csproj
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FluentValidation" Version="12.0.0" />
<PackageReference Include="FluentValidation" Version="12.1.0" />
<PackageReference Include="Handlebars.Net" Version="2.1.6" />
<PackageReference Include="Microsoft.Playwright" Version="1.55.0" />
<PackageReference Include="OperationResultTools" Version="1.0.32" />
<PackageReference Include="Microsoft.Playwright" Version="1.56.0" />
<PackageReference Include="OperationResultTools" Version="1.0.33" />
<PackageReference Include="RazorLight" Version="2.3.1" />
<PackageReference Include="Scriban" Version="6.5.0" />
<PackageReference Include="SimpleAuthenticationTools.Abstractions" Version="3.1.4" />
<PackageReference Include="TinyHelpers" Version="3.3.8" />
<PackageReference Include="SimpleAuthenticationTools.Abstractions" Version="3.1.5" />
<PackageReference Include="TinyHelpers" Version="3.3.9" />
</ItemGroup>

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

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand All @@ -11,7 +11,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.10" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="10.0.0" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion src/PdfSmith.Shared/PdfSmith.Shared.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,20 @@ namespace PdfSmith.BackgroundServices;

public class InstallPlaywrightBackgroundService(PlaywrightHealthCheck playwrightHealthCheck, ILogger<InstallPlaywrightBackgroundService> logger) : BackgroundService
{
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
protected override Task ExecuteAsync(CancellationToken stoppingToken)
{
// On Windows, it is installed in %USERPROFILE%\AppData\Local\ms-playwright by default.
// We can use PLAYWRIGHT_BROWSERS_PATH environment variable to change the default location.
var returnCode = await Task.Run(() =>
var returnCode = -1;

try
{
returnCode = Microsoft.Playwright.Program.Main(["install", "chromium"]);
}
catch (Exception ex)
{
try
{
return Microsoft.Playwright.Program.Main(["install", "chromium"]);
}
catch (Exception ex)
{
logger.LogError(ex, "Error while installing Chromium");
return -1;
}
}, stoppingToken);
logger.LogError(ex, "Error while installing Chromium");
}

var playwrightStatus = returnCode switch
{
Expand All @@ -28,5 +26,7 @@ protected override async Task ExecuteAsync(CancellationToken stoppingToken)
};

playwrightHealthCheck.Status = playwrightStatus;

return Task.CompletedTask;
}
}
22 changes: 11 additions & 11 deletions src/PdfSmith/PdfSmith.csproj
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<PreserveCompilationContext>true</PreserveCompilationContext>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Azure.Monitor.OpenTelemetry.AspNetCore" Version="1.3.0" />
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="12.0.0" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.10" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.10">
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="12.1.0" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="10.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="10.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore" Version="9.0.10" />
<PackageReference Include="MinimalHelpers.FluentValidation" Version="1.1.4" />
<PackageReference Include="OperationResultTools.AspNetCore.Http" Version="1.0.30" />
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore" Version="10.0.0" />
<PackageReference Include="MinimalHelpers.FluentValidation" Version="1.1.7" />
<PackageReference Include="OperationResultTools.AspNetCore.Http" Version="1.0.31" />
<PackageReference Include="Serilog.AspNetCore" Version="9.0.0" />
<PackageReference Include="Serilog.Expressions" Version="5.0.0" />
<PackageReference Include="Serilog.Sinks.MSSqlServer" Version="9.0.1" />
<PackageReference Include="SimpleAuthenticationTools" Version="3.1.6" />
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="9.0.6" />
<PackageReference Include="TinyHelpers.AspNetCore" Version="4.1.8" />
<PackageReference Include="Serilog.Sinks.MSSqlServer" Version="9.0.2" />
<PackageReference Include="SimpleAuthenticationTools" Version="3.1.9" />
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="10.0.1" />
<PackageReference Include="TinyHelpers.AspNetCore" Version="4.1.10" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/PdfSmith/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
using Microsoft.AspNetCore.Localization;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Diagnostics.HealthChecks;
using Microsoft.OpenApi.Models;
using Microsoft.OpenApi;
using MinimalHelpers.FluentValidation;
using OperationResults.AspNetCore.Http;
using PdfSmith.BackgroundServices;
Expand Down