Skip to content

Commit 62cab40

Browse files
upgrade to .net 9 and other style fixes (#102) [skip ci]
* Updated `SelectableTextBlock` to use a `MultiBinding` with a `StringFormat` to display the `Key` and `Value` properties. Updated avalonia and moved to .net 9 * updated to .net9 * Update packages, methods, and .NET version - Updated `Avalonia.Controls.ItemsRepeater` package to `11.1.5` in `KeyVaultExplorer.csproj`. - Added `using System.Threading.Tasks;` to `TitleBarControlViewModel.cs`. - Renamed `Signin` to `SignIn` and `Signout` to `SignOut`, changing their return types to `Task` in `TitleBarControlViewModel.cs`. - Updated .NET platform version to `net9.0` in `build.ps1`. - Updated `makeappx.exe` commands in `build.ps1` for new MSIX package versions. * updated to .net9
1 parent a151120 commit 62cab40

File tree

6 files changed

+35
-32
lines changed

6 files changed

+35
-32
lines changed

.github/workflows/dotnet.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: Setup .NET
1818
uses: actions/setup-dotnet@v4
1919
with:
20-
dotnet-version: 8.0.x
20+
dotnet-version: 9.0.x
2121
- uses: actions/cache@v3
2222
with:
2323
path: ~/.nuget/win-packages
@@ -47,7 +47,7 @@ jobs:
4747
- name: Setup .NET
4848
uses: actions/setup-dotnet@v4
4949
with:
50-
dotnet-version: 8.0.x
50+
dotnet-version: 9.0.x
5151
- uses: actions/cache@v3
5252
with:
5353
path: ~/.nuget/osx-intel-packages
@@ -76,7 +76,7 @@ jobs:
7676
- name: Setup .NET
7777
uses: actions/setup-dotnet@v4
7878
with:
79-
dotnet-version: 8.0.x
79+
dotnet-version: 9.0.x
8080
- uses: actions/cache@v3
8181
with:
8282
path: ~/.nuget/macos-arm-packages
@@ -107,7 +107,7 @@ jobs:
107107
- name: Setup .NET
108108
uses: actions/setup-dotnet@v4
109109
with:
110-
dotnet-version: 8.0.x
110+
dotnet-version: 9.0.x
111111
- uses: actions/cache@v3
112112
with:
113113
path: ~/.nuget/linux-packages

Desktop/Desktop.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
<OutputType>WinExe</OutputType>
44
<!--If you are willing to use Windows/MacOS native APIs you will need to create 3 projects.
55
One for Windows with net7.0-windows TFM, one for MacOS with net7.0-macos and one with net7.0 TFM for Linux.-->
6-
<TargetFrameworks>net8.0</TargetFrameworks>
6+
<TargetFrameworks>net9.0</TargetFrameworks>
77
<!-- <TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('osx'))">$(TargetFrameworks);net8.0-macos</TargetFrameworks> -->
8-
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
8+
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net9.0-windows10.0.19041.0</TargetFrameworks>
99
<WindowsSdkPackageVersion Condition="$([MSBuild]::IsOSPlatform('windows'))">10.0.19041.41</WindowsSdkPackageVersion>
1010

1111
<Nullable>enable</Nullable>
@@ -44,8 +44,8 @@
4444

4545

4646
<ItemGroup>
47-
<PackageReference Include="Avalonia.Desktop" Version="11.2.0" />
48-
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="9.0.0-rc.1.24431.7" />
47+
<PackageReference Include="Avalonia.Desktop" Version="11.2.1" />
48+
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="9.0.0" />
4949
</ItemGroup>
5050

5151

KeyVaultExplorer/KeyVaultExplorer.csproj

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>net8.0</TargetFrameworks>
4-
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
3+
<TargetFrameworks>net9.0</TargetFrameworks>
4+
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net9.0-windows10.0.19041.0</TargetFrameworks>
55
<WindowsSdkPackageVersion>10.0.19041.41</WindowsSdkPackageVersion>
66

77
<!-- <TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('osx'))">$(TargetFrameworks);net8.0-macos</TargetFrameworks> -->
@@ -53,17 +53,17 @@
5353

5454

5555
<ItemGroup>
56-
<PackageReference Include="Avalonia.Controls.ItemsRepeater" Version="11.1.4" />
57-
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.2.0" />
56+
<PackageReference Include="Avalonia.Controls.ItemsRepeater" Version="11.1.5" />
57+
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.2.1" />
5858
<PackageReference Include="Avalonia.Svg.Skia" Version="11.2.0" />
5959
<PackageReference Include="DeviceId" Version="6.7.0" />
6060
<PackageReference Include="FluentAvaloniaUI" Version="2.1.0" />
6161
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
62-
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.0-rc.1.24431.7" />
63-
<PackageReference Include="Microsoft.Data.Sqlite.Core" Version="9.0.0-rc.1.24451.1" />
62+
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.0" />
63+
<PackageReference Include="Microsoft.Data.Sqlite.Core" Version="9.0.0" />
6464
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.3.2" />
65-
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="9.0.0-rc.1.24431.7" />
66-
<PackageReference Include="Microsoft.Identity.Client.Extensions.Msal" Version="4.66.1" />
65+
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="9.0.0" />
66+
<PackageReference Include="Microsoft.Identity.Client.Extensions.Msal" Version="4.66.2" />
6767
<PackageReference Include="Azure.ResourceManager.KeyVault" Version="1.3.0" />
6868
<PackageReference Include="Azure.Security.KeyVault.Certificates" Version="4.7.0" />
6969
<PackageReference Include="Azure.Security.KeyVault.Keys" Version="4.7.0" />

KeyVaultExplorer/ViewModels/TitleBarControlViewModel.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using CommunityToolkit.Mvvm.Input;
33
using KeyVaultExplorer.Services;
44
using System.Threading;
5+
using System.Threading.Tasks;
56

67
namespace KeyVaultExplorer.ViewModels;
78

@@ -23,7 +24,7 @@ public TitleBarViewModel()
2324
}
2425

2526
[RelayCommand]
26-
private async void Signin()
27+
private async void SignIn()
2728
{
2829
var cancellation = new CancellationToken();
2930
var account = await _authService.RefreshTokenAsync(cancellation);
@@ -32,7 +33,7 @@ private async void Signin()
3233
}
3334

3435
[RelayCommand]
35-
private async void Signout()
36+
private async Task SignOut()
3637
{
3738
await _authService.RemoveAccount();
3839
}

KeyVaultExplorer/Views/Pages/PropertiesPage.axaml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -297,18 +297,20 @@
297297
</DataTemplate.DataType>
298298
<Border
299299
Margin="2"
300-
Padding="5,0,5,0"
300+
Padding="8,0,8,0"
301301
Background="{DynamicResource AccentFillColorSelectedTextBackgroundBrush}"
302302
CornerRadius="5">
303-
<StackPanel Orientation="Horizontal">
304-
<SelectableTextBlock
305-
VerticalAlignment="Center"
306-
Foreground="{DynamicResource TextOnAccentFillColorSelectedTextBrush}"
307-
TextWrapping="Wrap">
308-
<Label Content="{Binding Key, StringFormat={}{0:n0}:}" />
309-
<Label Content="{Binding Value}" />
310-
</SelectableTextBlock>
311-
</StackPanel>
303+
<SelectableTextBlock
304+
VerticalAlignment="Center"
305+
Foreground="{DynamicResource TextOnAccentFillColorSelectedTextBrush}"
306+
TextWrapping="Wrap">
307+
<SelectableTextBlock.Text>
308+
<MultiBinding StringFormat="{}{0}: {1}">
309+
<Binding Path="Key" />
310+
<Binding Path="Value" />
311+
</MultiBinding>
312+
</SelectableTextBlock.Text>
313+
</SelectableTextBlock>
312314
</Border>
313315
</DataTemplate>
314316
</ItemsRepeater.ItemTemplate>

build.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ param(
33
[string]$BuildNumber = '1.0.0.0',
44
$VersionPrefix = "1.0.0",
55
$VersionSuffix = "99",
6-
[ValidateSet('net8.0', 'net8.0-windows10.0.19041.0', "net8.0-macos")]
7-
[string]$Platform = 'net8.0',
6+
[ValidateSet('net9.0', 'net9.0-windows10.0.19041.0', "net9.0-macos")]
7+
[string]$Platform = 'net9.0',
88
[ValidateSet('win-x64', 'win-arm64', 'osx-x64', 'osx-arm64', 'linux-x64')]
99
[string]$Runtime = 'win-x64',
1010
[Switch]$CreateMacOSBundle = $false
@@ -80,6 +80,6 @@ if ($Runtime -eq "osx-x64") {
8080
# //TODO create a script that can edit the appxmanifest to change settings and repack the app for msft store submission
8181
# mpdev build .\msix.json
8282
# Push-Location 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\'
83-
# .\makeappx.exe unpack /v /p "C:\repos\AzureKeyVaultExplorer\mpdev\Key Vault Explorer\output\Key Vault Explorer 1.0.263.0.msix" /d "C:\repos\AzureKeyVaultExplorer\mpdev\Key Vault Explorer\output\Unpacked"
84-
# .\makeappx.exe pack /v /d "C:\repos\AzureKeyVaultExplorer\mpdev\Key Vault Explorer\output\Unpacked" /p "C:\repos\AzureKeyVaultExplorer\mpdev\Key Vault Explorer\output\KeyVaultExplorerforAzure_1263_1.msix"
83+
# .\makeappx.exe unpack /v /p "C:\repos\AzureKeyVaultExplorer\mpdev\Key Vault Explorer\output\Key Vault Explorer 1.0.302.0.msix" /d "C:\repos\AzureKeyVaultExplorer\mpdev\Key Vault Explorer\output\Unpacked"
84+
# .\makeappx.exe pack /v /d "C:\repos\AzureKeyVaultExplorer\mpdev\Key Vault Explorer\output\Unpacked" /p "C:\repos\AzureKeyVaultExplorer\mpdev\Key Vault Explorer\output\KeyVaultExplorerforAzure_1302x86.msix"
8585

0 commit comments

Comments
 (0)