Skip to content

Commit

Permalink
Updated solution to .NET 9 and updated packages
Browse files Browse the repository at this point in the history
  • Loading branch information
jschick04 authored and bill-long committed Nov 14, 2024
1 parent 7cca389 commit 5be0846
Show file tree
Hide file tree
Showing 11 changed files with 55 additions and 52 deletions.
4 changes: 2 additions & 2 deletions azure-pipeline-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ extends:
- task: UseDotNet@2
displayName: 'Install .NET SDK'
inputs:
version: '8.x'
version: '9.x'
performMultiLevelLookup: true
- script: dotnet workload restore src/EventLogExpert.sln
displayName: 'dotnet workload restore'
Expand All @@ -50,7 +50,7 @@ extends:
dotnet publish src/EventLogExpert.EventDbTool/EventLogExpert.EventDbTool.csproj ` --self-contained ` -c Release ` -o "$(build.artifactStagingDirectory)" ` -p:IncludeNativeLibrariesForSelfExtract=true ` -p:PublishSingleFile=true ` -p:Version=$(ReleaseVersion)
displayName: 'dotnet publish EventDbTool'
- pwsh: >
dotnet publish src/EventLogExpert/EventLogExpert.csproj ` -c Release ` -f net8.0-windows10.0.19041.0 ` -p:AppxBundle=Never ` -p:AppInstallerCheckForUpdateFrequency=OnApplicationRun ` -p:AppInstallerUpdateFrequency=1 ` -p:AppInstallerUri="https://github.com/microsoft/EventLogExpert/releases/latest/download/" ` -p:GenerateAppInstallerFile=true ` -p:OutputPath="$(build.artifactStagingDirectory)\AppInstaller\" ` -p:RuntimeIdentifierOverride=win10-x64 ` -p:UapAppxPackageBuildMode=SideLoadOnly ` -p:Version=$(ReleaseVersion)
dotnet publish src/EventLogExpert/EventLogExpert.csproj ` -c Release ` -f net9.0-windows10.0.19041.0 ` -p:AppxBundle=Never ` -p:AppInstallerCheckForUpdateFrequency=OnApplicationRun ` -p:AppInstallerUpdateFrequency=1 ` -p:AppInstallerUri="https://github.com/microsoft/EventLogExpert/releases/latest/download/" ` -p:GenerateAppInstallerFile=true ` -p:OutputPath="$(build.artifactStagingDirectory)\AppInstaller\" ` -p:RuntimeIdentifierOverride=win10-x64 ` -p:UapAppxPackageBuildMode=SideLoadOnly ` -p:Version=$(ReleaseVersion)
displayName: 'dotnet publish EventLogExpert'
- pwsh: |
Get-ChildItem -Recurse "$(build.artifactStagingDirectory)"
Expand Down
4 changes: 2 additions & 2 deletions azure-pipeline-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ extends:
- task: UseDotNet@2
displayName: 'Install .NET SDK'
inputs:
version: '8.x'
version: '9.x'
performMultiLevelLookup: true
- script: dotnet workload restore src/EventLogExpert.sln
displayName: 'dotnet workload restore'
Expand All @@ -50,7 +50,7 @@ extends:
dotnet publish src/EventLogExpert.EventDbTool/EventLogExpert.EventDbTool.csproj ` --self-contained ` -c Release ` -o "$(build.artifactStagingDirectory)" ` -p:IncludeNativeLibrariesForSelfExtract=true ` -p:PublishSingleFile=true ` -p:Version=$(ReleaseVersion)
displayName: 'dotnet publish EventDbTool'
- pwsh: >
dotnet publish src/EventLogExpert/EventLogExpert.csproj ` -c Release ` -f net8.0-windows10.0.19041.0 ` -p:AppxBundle=Never ` -p:AppInstallerCheckForUpdateFrequency=OnApplicationRun ` -p:AppInstallerUpdateFrequency=1 ` -p:AppInstallerUri="https://github.com/microsoft/EventLogExpert/releases/latest/download/" ` -p:GenerateAppInstallerFile=true ` -p:OutputPath="$(build.artifactStagingDirectory)\AppInstaller\" ` -p:RuntimeIdentifierOverride=win10-x64 ` -p:UapAppxPackageBuildMode=SideLoadOnly ` -p:Version=$(ReleaseVersion)
dotnet publish src/EventLogExpert/EventLogExpert.csproj ` -c Release ` -f net9.0-windows10.0.19041.0 ` -p:AppxBundle=Never ` -p:AppInstallerCheckForUpdateFrequency=OnApplicationRun ` -p:AppInstallerUpdateFrequency=1 ` -p:AppInstallerUri="https://github.com/microsoft/EventLogExpert/releases/latest/download/" ` -p:GenerateAppInstallerFile=true ` -p:OutputPath="$(build.artifactStagingDirectory)\AppInstaller\" ` -p:RuntimeIdentifierOverride=win10-x64 ` -p:UapAppxPackageBuildMode=SideLoadOnly ` -p:Version=$(ReleaseVersion)
displayName: 'dotnet publish EventLogExpert'
- pwsh: |
Get-ChildItem -Recurse "$(build.artifactStagingDirectory)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
<TargetFramework>net9.0-windows10.0.19041.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PlatformTarget>x64</PlatformTarget>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
<TargetFramework>net9.0-windows10.0.19041.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

Expand All @@ -10,18 +10,18 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="NSubstitute" Version="5.1.0" />
<PackageReference Include="NSubstitute.Analyzers.CSharp" Version="1.0.16">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="NSubstitute" Version="5.3.0" />
<PackageReference Include="NSubstitute.Analyzers.CSharp" Version="1.0.17">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit" Version="2.6.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.5">
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.0">
<PackageReference Include="coverlet.collector" Version="6.0.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
6 changes: 3 additions & 3 deletions src/EventLogExpert.Eventing/EventLogExpert.Eventing.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<!-- <TargetFrameworks>net8.0-maccatalyst</TargetFrameworks> -->
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net9.0-windows10.0.19041.0</TargetFrameworks>
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
<!-- <TargetFrameworks>$(TargetFrameworks);net8.0-tizen</TargetFrameworks> -->
<SingleProject>true</SingleProject>
Expand All @@ -19,8 +19,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.0" />
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.3.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.0" />
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.4.8" />
</ItemGroup>

</Project>
14 changes: 7 additions & 7 deletions src/EventLogExpert.UI.Tests/EventLogExpert.UI.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
<TargetFramework>net9.0-windows10.0.19041.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="NSubstitute" Version="5.1.0" />
<PackageReference Include="NSubstitute.Analyzers.CSharp" Version="1.0.16">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="NSubstitute" Version="5.3.0" />
<PackageReference Include="NSubstitute.Analyzers.CSharp" Version="1.0.17">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit" Version="2.6.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.5">
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.0">
<PackageReference Include="coverlet.collector" Version="6.0.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
4 changes: 2 additions & 2 deletions src/EventLogExpert.UI/EventLogExpert.UI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<!-- <TargetFrameworks>net8.0-maccatalyst</TargetFrameworks> -->
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net9.0-windows10.0.19041.0</TargetFrameworks>
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
<!-- <TargetFrameworks>$(TargetFrameworks);net8.0-tizen</TargetFrameworks> -->
<SingleProject>true</SingleProject>
Expand All @@ -18,7 +18,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Fluxor.Blazor.Web" Version="6.0.0" />
<PackageReference Include="Fluxor.Blazor.Web" Version="6.1.0" />
</ItemGroup>

<ItemGroup>
Expand Down
43 changes: 23 additions & 20 deletions src/EventLogExpert/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ namespace EventLogExpert;

public sealed partial class App : Application
{
private readonly MainPage _mainPage;

public App(
IActionSubscriber actionSubscriber,
IDispatcher fluxorDispatcher,
Expand All @@ -37,30 +39,31 @@ public App(
{
InitializeComponent();

MainPage = new NavigationPage(
new MainPage(
actionSubscriber,
fluxorDispatcher,
databaseCollectionProvider,
activeLogsState,
continuouslyUpdateState,
filterPaneIsEnabledState,
loadedDatabasesState,
settingsState,
dialogService,
clipboardService,
updateService,
currentVersionProvider,
appTitleService,
fileLocationOptions,
traceLogger));
_mainPage = new MainPage(
actionSubscriber,
fluxorDispatcher,
databaseCollectionProvider,
activeLogsState,
continuouslyUpdateState,
filterPaneIsEnabledState,
loadedDatabasesState,
settingsState,
dialogService,
clipboardService,
updateService,
currentVersionProvider,
appTitleService,
fileLocationOptions,
traceLogger);
}

protected override Window CreateWindow(IActivationState? activationState)
{
var window = base.CreateWindow(activationState);

window.Title = "EventLogExpert";
var window = new Window
{
Title = "EventLogExpert",
Page = new NavigationPage(_mainPage)
};

// Ultrawide monitors create a window that is way too wide
if (DeviceDisplay.Current.MainDisplayInfo.Width >= 2048)
Expand Down
4 changes: 2 additions & 2 deletions src/EventLogExpert/EventLogExpert.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<!-- <TargetFrameworks>net8.0-maccatalyst</TargetFrameworks> -->
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net9.0-windows10.0.19041.0</TargetFrameworks>
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
<!-- <TargetFrameworks>$(TargetFrameworks);net8.0-tizen</TargetFrameworks> -->

Expand Down Expand Up @@ -77,7 +77,7 @@
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.14" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.14" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebView.Maui" Version="8.0.14" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="9.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/EventLogExpert/MainPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ private void EnableAddLogToViewViaDragAndDrop()
}

private void Exit_Clicked(object sender, EventArgs e) =>
Application.Current?.CloseWindow(Application.Current.MainPage!.Window!);
Application.Current?.CloseWindow(Application.Current.Windows[0].Page!.Window!);

private void LoadNewEvents_Clicked(object sender, EventArgs e) =>
_fluxorDispatcher.Dispatch(new EventLogAction.LoadNewEvents());
Expand All @@ -310,7 +310,7 @@ private async void OpenFile_Clicked(object sender, EventArgs e)

foreach (var file in logs)
{
await OpenLog(file!.FullPath, PathType.FilePath, shouldAddLog:true);
await OpenLog(file!.FullPath, PathType.FilePath, shouldAddLog: true);
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/EventLogExpert/MauiProgram.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ public static MauiApp CreateMauiApp()
builder.Services.AddSingleton<IClipboardService, ClipboardService>();

builder.Services.AddSingleton<IAlertDialogService>(new AlertDialogService(
async (title, message, cancel) => await Application.Current!.MainPage!.DisplayAlert(title, message, cancel),
async (title, message, accept, cancel) => await Application.Current!.MainPage!.DisplayAlert(title, message, accept, cancel),
async (title, message) => await Application.Current!.MainPage!.DisplayPromptAsync(title, message),
async (title, message, value) => await Application.Current!.MainPage!.DisplayPromptAsync(title, message, initialValue: value)));
async (title, message, cancel) => await Application.Current!.Windows[0].Page!.DisplayAlert(title, message, cancel),
async (title, message, accept, cancel) => await Application.Current!.Windows[0].Page!.DisplayAlert(title, message, accept, cancel),
async (title, message) => await Application.Current!.Windows[0].Page!.DisplayPromptAsync(title, message),
async (title, message, value) => await Application.Current!.Windows[0].Page!.DisplayPromptAsync(title, message, initialValue: value)));

return builder.Build();
}
Expand Down

0 comments on commit 5be0846

Please sign in to comment.