diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 66a3b36ba..04c47720d 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -8,7 +8,8 @@ on: branches: [master] schedule: - cron: '26 22 * * 0' - +env: + caliburn_sln : "src\\caliburn.micro.sln" jobs: analyse: name: Analyse @@ -65,10 +66,10 @@ jobs: run: dotnet workload list - name: Restore nuget packages - run: msbuild src\caliburn.micro.sln -t:restore + run: msbuild ${{env.caliburn_sln}} -t:restore - name: Build app for release - run: msbuild src\caliburn.micro.sln /t:Build + run: msbuild ${{env.caliburn_sln}} /t:Build # ℹ️ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl diff --git a/azure-pipeline.yml b/azure-pipeline.yml index 8c1e348fb..6eac9e207 100644 --- a/azure-pipeline.yml +++ b/azure-pipeline.yml @@ -15,7 +15,7 @@ steps: displayName: 'Install .NET' inputs: packageType: 'sdk' - version: '8.0.x' + version: '9.0.x' - task: PowerShell@2 diff --git a/samples/features/Features.NetFive/Features.DotNet.csproj b/samples/features/Features.NetFive/Features.DotNet.csproj index 0c8c93993..cafeaa540 100644 --- a/samples/features/Features.NetFive/Features.DotNet.csproj +++ b/samples/features/Features.NetFive/Features.DotNet.csproj @@ -2,7 +2,7 @@ WinExe - net8.0-windows + net9.0-windows true Features.CrossPlatform Features.CrossPlatform @@ -23,10 +23,10 @@ - ..\..\..\bin\Caliburn.Micro.Platform\release\net8.0-windows\Caliburn.Micro.Core.dll + ..\..\..\bin\Caliburn.Micro.Platform\release\net9.0-windows\Caliburn.Micro.Core.dll - ..\..\..\bin\Caliburn.Micro.Platform\release\net8.0-windows\Caliburn.Micro.Platform.dll + ..\..\..\bin\Caliburn.Micro.Platform\release\net9.0-windows\Caliburn.Micro.Platform.dll diff --git a/samples/setup/Setup.UWP/Setup.UWP.csproj b/samples/setup/Setup.UWP/Setup.UWP.csproj index b487e2f13..7888d0233 100644 --- a/samples/setup/Setup.UWP/Setup.UWP.csproj +++ b/samples/setup/Setup.UWP/Setup.UWP.csproj @@ -127,7 +127,7 @@ 4.0.173 - 6.2.12 + 6.2.14 diff --git a/samples/setup/Setup.WPF.Core.VB/Bootstrapper.vb b/samples/setup/Setup.WPF.Core.VB/Bootstrapper.vb index 5fa1593d3..8f13e1bb0 100644 --- a/samples/setup/Setup.WPF.Core.VB/Bootstrapper.vb +++ b/samples/setup/Setup.WPF.Core.VB/Bootstrapper.vb @@ -18,7 +18,7 @@ Public Class Bootstrapper End Sub Protected Overrides Sub OnStartup(sender As Object, e As StartupEventArgs) - DisplayRootViewFor(Of ShellViewModel)() + DisplayRootViewForAsync(Of ShellViewModel)() End Sub Protected Overrides Function GetInstance(service As Type, key As String) As Object diff --git a/samples/setup/Setup.WPF.Core.VB/Setup.WPF.Core.VB.vbproj b/samples/setup/Setup.WPF.Core.VB/Setup.WPF.Core.VB.vbproj index e620206aa..b25bdcff5 100644 --- a/samples/setup/Setup.WPF.Core.VB/Setup.WPF.Core.VB.vbproj +++ b/samples/setup/Setup.WPF.Core.VB/Setup.WPF.Core.VB.vbproj @@ -2,7 +2,7 @@ WinExe - net8.0-windows + net9.0-windows Setup.WPF.Core.VB true @@ -20,7 +20,7 @@ - + diff --git a/samples/setup/Setup.WPF.Core/Bootstrapper.cs b/samples/setup/Setup.WPF.Core/Bootstrapper.cs index 5d1c4b3ce..0b9384619 100644 --- a/samples/setup/Setup.WPF.Core/Bootstrapper.cs +++ b/samples/setup/Setup.WPF.Core/Bootstrapper.cs @@ -1,8 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows; using Caliburn.Micro; using Setup.WPF.Core.ViewModels; @@ -30,7 +27,7 @@ protected override void Configure() protected override void OnStartup(object sender, StartupEventArgs e) { - DisplayRootViewFor(); + DisplayRootViewForAsync(); } protected override object GetInstance(Type service, string key) diff --git a/samples/setup/Setup.WPF.Core/Setup.WPF.Core.csproj b/samples/setup/Setup.WPF.Core/Setup.WPF.Core.csproj index 8354fadc7..93b91a125 100644 --- a/samples/setup/Setup.WPF.Core/Setup.WPF.Core.csproj +++ b/samples/setup/Setup.WPF.Core/Setup.WPF.Core.csproj @@ -2,12 +2,12 @@ WinExe - net8.0-windows + net9.0-windows true - + diff --git a/src/Caliburn.Micro.Core.Tests/EventAggregatorTests.cs b/src/Caliburn.Micro.Core.Tests/EventAggregatorTests.cs index 02f764447..5e501e37d 100644 --- a/src/Caliburn.Micro.Core.Tests/EventAggregatorTests.cs +++ b/src/Caliburn.Micro.Core.Tests/EventAggregatorTests.cs @@ -26,12 +26,12 @@ public void A_valid_subscriber_is_assigned_as_a_handler_its_message_type() { var handlerStub = new Mock>().Object; var aggregator = new EventAggregator(); - - Assert.False(aggregator.HandlerExistsFor(typeof(object))); + var messageType = typeof(object); + Assert.False(aggregator.HandlerExistsFor(messageType)); aggregator.SubscribeOnPublishedThread(handlerStub); - Assert.True(aggregator.HandlerExistsFor(typeof(object))); + Assert.True(aggregator.HandlerExistsFor(messageType)); } } diff --git a/src/Caliburn.Micro.Core/EventAggregator.cs b/src/Caliburn.Micro.Core/EventAggregator.cs index 2143c074a..6190b9cba 100644 --- a/src/Caliburn.Micro.Core/EventAggregator.cs +++ b/src/Caliburn.Micro.Core/EventAggregator.cs @@ -10,6 +10,8 @@ namespace Caliburn.Micro /// public class EventAggregator : IEventAggregator { + private static readonly ILog Log = LogManager.GetLog(typeof(EventAggregator)); + private readonly List _handlers = new List(); /// @@ -17,6 +19,8 @@ public virtual bool HandlerExistsFor(Type messageType) { lock (_handlers) { + Log.Info("Checking if handler exists for {0}.", messageType.FullName); + Log.Info("There are {0} handlers registered.", _handlers.Count); return _handlers.Any(handler => handler.Handles(messageType) && !handler.IsDead); } } @@ -38,9 +42,10 @@ public virtual void Subscribe(object subscriber, Func, Task> marshal) { if (_handlers.Any(x => x.Matches(subscriber))) { + Log.Info("Message Handler exists"); return; } - + Log.Info("Message Handler Adding it"); _handlers.Add(new Handler(subscriber, marshal)); } } diff --git a/src/Caliburn.Micro.Platform/Caliburn.Micro.Platform.csproj b/src/Caliburn.Micro.Platform/Caliburn.Micro.Platform.csproj index 5e08e3305..34917cb36 100644 --- a/src/Caliburn.Micro.Platform/Caliburn.Micro.Platform.csproj +++ b/src/Caliburn.Micro.Platform/Caliburn.Micro.Platform.csproj @@ -1,7 +1,7 @@  - net462;uap10.0.19041;net8.0-android;net8.0-ios;net8.0-windows; + net462;uap10.0.19041;net8.0-android;net8.0-ios;net9.0-android;net9.0-ios;net8.0-windows;net9.0-windows Caliburn.Micro Caliburn.Micro Caliburn.Micro @@ -52,6 +52,10 @@ + + + + @@ -79,6 +83,18 @@ + + + + + + + + + + + + diff --git a/src/global.json b/src/global.json index 0a13e1705..18141da90 100644 --- a/src/global.json +++ b/src/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.x", + "version": "9.0.x", "rollForward": "latestFeature" }, "msbuild-sdks": {