diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 8911a424..3a29f6ee 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -14,18 +14,18 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: fetch-depth: 0 - name: Setup .NET Core SDK - uses: actions/setup-dotnet@v4 + uses: actions/setup-dotnet@v5 with: - dotnet-version: '9.0.x' + dotnet-version: '10.0.x' - name: Initialize CodeQL - uses: github/codeql-action/init@v3 + uses: github/codeql-action/init@v4 with: languages: 'csharp' - name: Autobuild - uses: github/codeql-action/autobuild@v3 + uses: github/codeql-action/autobuild@v4 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 \ No newline at end of file + uses: github/codeql-action/analyze@v4 \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7b33be2b..6d075d55 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,17 +17,17 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout sources - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: fetch-depth: 0 - name: Setup .NET - uses: actions/setup-dotnet@v4 + uses: actions/setup-dotnet@v5 with: - dotnet-version: '9.0.x' + dotnet-version: '10.0.x' - name: Create packages run: dotnet pack --configuration Release --output ./packages - name: Upload a Build Artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v5 with: name: NuGet packages path: packages/*.* @@ -40,12 +40,12 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout sources - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: fetch-depth: 0 - name: Setup .NET - uses: actions/setup-dotnet@v4 - - uses: actions/download-artifact@v4 + uses: actions/setup-dotnet@v5 + - uses: actions/download-artifact@v6 with: name: NuGet packages path: packages diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 84d7468c..ecb52d5c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,12 +18,12 @@ jobs: runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: fetch-depth: 0 - - uses: actions/setup-dotnet@v4 + - uses: actions/setup-dotnet@v5 with: - dotnet-version: '9.0.x' + dotnet-version: '10.0.x' - name: Build & Test in Release Mode run: dotnet test --configuration Release --logger "GitHubActions" \ No newline at end of file diff --git a/Directory.Build.props b/Directory.Build.props index 92884873..b10fafc0 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -29,7 +29,7 @@ all - 3.7.115 + 3.9.50 diff --git a/PetroGlyphGameInfrastructure.sln b/PetroGlyphGameInfrastructure.sln deleted file mode 100644 index e7fd9cc6..00000000 --- a/PetroGlyphGameInfrastructure.sln +++ /dev/null @@ -1,93 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.0.31717.71 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{DDF4836A-1257-4323-A288-B5F277242010}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{91EC3980-0C87-484F-91E5-0FE684C1D2E0}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AET.SteamAbstraction", "src\AET.SteamAbstraction\AET.SteamAbstraction.csproj", "{8C4EA230-C426-150D-D7B3-EA1E855E255B}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PG.StarWarsGame.Infrastructure", "src\PG.StarWarsGame.Infrastructure\PG.StarWarsGame.Infrastructure.csproj", "{B9F11D14-D989-BDCA-9269-454382B01C53}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PG.StarWarsGame.Infrastructure.Test", "test\PG.StarWarsGame.Infrastructure.Test\PG.StarWarsGame.Infrastructure.Test.csproj", "{F7053C64-A450-9DEA-5498-A87A97577105}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PG.StarWarsGame.Infrastructure.Clients.Steam", "src\PG.StarWarsGame.Infrastructure.Clients.Steam\PG.StarWarsGame.Infrastructure.Clients.Steam.csproj", "{F4D99F05-BC5F-5132-2C52-46F62BC056FC}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PG.TestingUtilities", "test\PG.TestingUtilities\PG.TestingUtilities.csproj", "{74C227B8-02EB-7B90-EAEF-61488C697007}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PG.StarWarsGame.Infrastructure.Testing", "test\PG.StarWarsGame.Infrastructure.Testing\PG.StarWarsGame.Infrastructure.Testing.csproj", "{06140CFC-149B-74F4-F4E4-CA9B143D75C9}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PG.StarWarsGame.Infrastructure.Clients.Steam.Test", "test\PG.StarWarsGame.Infrastructure.Clients.Steam.Test\PG.StarWarsGame.Infrastructure.Clients.Steam.Test.csproj", "{CCAB24B1-B9CC-BDCB-A095-F4E3A81FD2DC}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AET.SteamAbstraction.Test", "test\AET.SteamAbstraction.Test\AET.SteamAbstraction.Test.csproj", "{838099F7-115E-50F3-7091-E48526ADC83C}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AET.SteamAbstraction.Testing", "test\AET.SteamAbstraction.Testing\AET.SteamAbstraction.Testing.csproj", "{C5BACDAD-F846-F75F-12DE-1EF1A8319549}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleApplication", "sampleApp\SampleApplication.csproj", "{19F0E685-5B50-C6D7-C50F-A04941FD9663}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {8C4EA230-C426-150D-D7B3-EA1E855E255B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8C4EA230-C426-150D-D7B3-EA1E855E255B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8C4EA230-C426-150D-D7B3-EA1E855E255B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8C4EA230-C426-150D-D7B3-EA1E855E255B}.Release|Any CPU.Build.0 = Release|Any CPU - {B9F11D14-D989-BDCA-9269-454382B01C53}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B9F11D14-D989-BDCA-9269-454382B01C53}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B9F11D14-D989-BDCA-9269-454382B01C53}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B9F11D14-D989-BDCA-9269-454382B01C53}.Release|Any CPU.Build.0 = Release|Any CPU - {F7053C64-A450-9DEA-5498-A87A97577105}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F7053C64-A450-9DEA-5498-A87A97577105}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F7053C64-A450-9DEA-5498-A87A97577105}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F7053C64-A450-9DEA-5498-A87A97577105}.Release|Any CPU.Build.0 = Release|Any CPU - {F4D99F05-BC5F-5132-2C52-46F62BC056FC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F4D99F05-BC5F-5132-2C52-46F62BC056FC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F4D99F05-BC5F-5132-2C52-46F62BC056FC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F4D99F05-BC5F-5132-2C52-46F62BC056FC}.Release|Any CPU.Build.0 = Release|Any CPU - {74C227B8-02EB-7B90-EAEF-61488C697007}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {74C227B8-02EB-7B90-EAEF-61488C697007}.Debug|Any CPU.Build.0 = Debug|Any CPU - {74C227B8-02EB-7B90-EAEF-61488C697007}.Release|Any CPU.ActiveCfg = Release|Any CPU - {74C227B8-02EB-7B90-EAEF-61488C697007}.Release|Any CPU.Build.0 = Release|Any CPU - {06140CFC-149B-74F4-F4E4-CA9B143D75C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {06140CFC-149B-74F4-F4E4-CA9B143D75C9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {06140CFC-149B-74F4-F4E4-CA9B143D75C9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {06140CFC-149B-74F4-F4E4-CA9B143D75C9}.Release|Any CPU.Build.0 = Release|Any CPU - {CCAB24B1-B9CC-BDCB-A095-F4E3A81FD2DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CCAB24B1-B9CC-BDCB-A095-F4E3A81FD2DC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CCAB24B1-B9CC-BDCB-A095-F4E3A81FD2DC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CCAB24B1-B9CC-BDCB-A095-F4E3A81FD2DC}.Release|Any CPU.Build.0 = Release|Any CPU - {838099F7-115E-50F3-7091-E48526ADC83C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {838099F7-115E-50F3-7091-E48526ADC83C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {838099F7-115E-50F3-7091-E48526ADC83C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {838099F7-115E-50F3-7091-E48526ADC83C}.Release|Any CPU.Build.0 = Release|Any CPU - {C5BACDAD-F846-F75F-12DE-1EF1A8319549}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C5BACDAD-F846-F75F-12DE-1EF1A8319549}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C5BACDAD-F846-F75F-12DE-1EF1A8319549}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C5BACDAD-F846-F75F-12DE-1EF1A8319549}.Release|Any CPU.Build.0 = Release|Any CPU - {19F0E685-5B50-C6D7-C50F-A04941FD9663}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {19F0E685-5B50-C6D7-C50F-A04941FD9663}.Debug|Any CPU.Build.0 = Debug|Any CPU - {19F0E685-5B50-C6D7-C50F-A04941FD9663}.Release|Any CPU.ActiveCfg = Release|Any CPU - {19F0E685-5B50-C6D7-C50F-A04941FD9663}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {8C4EA230-C426-150D-D7B3-EA1E855E255B} = {DDF4836A-1257-4323-A288-B5F277242010} - {B9F11D14-D989-BDCA-9269-454382B01C53} = {DDF4836A-1257-4323-A288-B5F277242010} - {F7053C64-A450-9DEA-5498-A87A97577105} = {91EC3980-0C87-484F-91E5-0FE684C1D2E0} - {F4D99F05-BC5F-5132-2C52-46F62BC056FC} = {DDF4836A-1257-4323-A288-B5F277242010} - {74C227B8-02EB-7B90-EAEF-61488C697007} = {91EC3980-0C87-484F-91E5-0FE684C1D2E0} - {06140CFC-149B-74F4-F4E4-CA9B143D75C9} = {91EC3980-0C87-484F-91E5-0FE684C1D2E0} - {CCAB24B1-B9CC-BDCB-A095-F4E3A81FD2DC} = {91EC3980-0C87-484F-91E5-0FE684C1D2E0} - {838099F7-115E-50F3-7091-E48526ADC83C} = {91EC3980-0C87-484F-91E5-0FE684C1D2E0} - {C5BACDAD-F846-F75F-12DE-1EF1A8319549} = {91EC3980-0C87-484F-91E5-0FE684C1D2E0} - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {76D00646-2467-4997-A19B-8299D8724D38} - EndGlobalSection -EndGlobal diff --git a/PetroGlyphGameInfrastructure.slnx b/PetroGlyphGameInfrastructure.slnx new file mode 100644 index 00000000..c29d09ef --- /dev/null +++ b/PetroGlyphGameInfrastructure.slnx @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/sampleApp/SampleApplication.csproj b/sampleApp/SampleApplication.csproj index cab8abb7..a11f4422 100644 --- a/sampleApp/SampleApplication.csproj +++ b/sampleApp/SampleApplication.csproj @@ -1,13 +1,13 @@ - + Exe - net9.0-windows + net10.0-windows false - + diff --git a/src/AET.SteamAbstraction/AET.SteamAbstraction.csproj b/src/AET.SteamAbstraction/AET.SteamAbstraction.csproj index 7a6c3447..8386272e 100644 --- a/src/AET.SteamAbstraction/AET.SteamAbstraction.csproj +++ b/src/AET.SteamAbstraction/AET.SteamAbstraction.csproj @@ -1,4 +1,4 @@ - + netstandard2.0 AET.SteamAbstraction @@ -21,16 +21,16 @@ true - + - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/src/AET.SteamAbstraction/Library/SteamLibrary.cs b/src/AET.SteamAbstraction/Library/SteamLibrary.cs index 330ca8b2..8be9d434 100644 --- a/src/AET.SteamAbstraction/Library/SteamLibrary.cs +++ b/src/AET.SteamAbstraction/Library/SteamLibrary.cs @@ -66,7 +66,7 @@ public IEnumerable GetApps() } catch (SteamException e) { - _logger?.LogWarning(e, $"Could not read game manifest file '{manifestFile}': {e.Message}"); + _logger?.LogWarning(e, "Could not read game manifest file '{ManifestFile}': {Message}", manifestFile, e.Message); } } return apps; diff --git a/src/AET.SteamAbstraction/Library/SteamLibraryFinder.cs b/src/AET.SteamAbstraction/Library/SteamLibraryFinder.cs index 3a6f2238..6292d0d9 100644 --- a/src/AET.SteamAbstraction/Library/SteamLibraryFinder.cs +++ b/src/AET.SteamAbstraction/Library/SteamLibraryFinder.cs @@ -45,12 +45,12 @@ public IEnumerable FindLibraries(IDirectoryInfo steamInstallDir) private bool TryCreateLibraryFromLocation(IDirectoryInfo libraryLocation, bool isDefault, [NotNullWhen(true)] out SteamLibrary? library) { - _logger?.LogTrace($"Try creating steam library from location '{libraryLocation.FullName}'"); + _logger?.LogTrace("Try creating steam library from location '{Library}'", libraryLocation.FullName); library = null; if (!libraryLocation.Exists) { - _logger?.LogTrace($"Steam library location '{libraryLocation.FullName}' does not exist. Library not created."); + _logger?.LogTrace("Steam library location '{Library}' does not exist. Library not created.", libraryLocation.FullName); return false; } @@ -59,7 +59,7 @@ private bool TryCreateLibraryFromLocation(IDirectoryInfo libraryLocation, bool i var steamDll = _fileSystem.Path.Combine(libraryLocation.FullName, SteamDllFileName); if (!_fileSystem.File.Exists(steamDll)) { - _logger?.LogTrace($"Steam library location '{libraryLocation.FullName}' does not contain 'steam.dll'. Library not created."); + _logger?.LogTrace("Steam library location '{Library}' does not contain 'steam.dll'. Library not created.", libraryLocation.FullName); return false; } } @@ -75,7 +75,7 @@ private bool TryCreateLibraryFromLocation(IDirectoryInfo libraryLocation, bool i var libraryVdf = _fileSystem.Path.Combine(libraryLocation.FullName, libraryVdfSubPath, libraryVdfName); if (!_fileSystem.File.Exists(libraryVdf)) { - _logger?.LogTrace($"Steam library VDF file '{libraryVdf}' was not found. Library not created."); + _logger?.LogTrace("Steam library VDF file '{Library}' was not found. Library not created.", libraryVdf); return false; } diff --git a/src/PG.StarWarsGame.Infrastructure/Clients/PetroglyphStarWarsGameClient.cs b/src/PG.StarWarsGame.Infrastructure/Clients/PetroglyphStarWarsGameClient.cs index c3f03020..b0272de8 100644 --- a/src/PG.StarWarsGame.Infrastructure/Clients/PetroglyphStarWarsGameClient.cs +++ b/src/PG.StarWarsGame.Infrastructure/Clients/PetroglyphStarWarsGameClient.cs @@ -90,7 +90,7 @@ public IGameProcess Debug(ArgumentCollection arguments, bool fallbackToPlay) if (!fallbackToPlay) throw new GameStartException(Game, "Debug version of the game could not be found."); buildType = GameBuildType.Release; - Logger?.LogTrace($"Falling back to release configuration because debug executables of '{Game}' were not found."); + Logger?.LogTrace("Falling back to release configuration because debug executables of '{Game}' were not found.", Game); } return StartGame(arguments, buildType); } diff --git a/src/PG.StarWarsGame.Infrastructure/Clients/Processes/GameProcessLauncher.cs b/src/PG.StarWarsGame.Infrastructure/Clients/Processes/GameProcessLauncher.cs index caf951f2..f47a9800 100644 --- a/src/PG.StarWarsGame.Infrastructure/Clients/Processes/GameProcessLauncher.cs +++ b/src/PG.StarWarsGame.Infrastructure/Clients/Processes/GameProcessLauncher.cs @@ -18,8 +18,7 @@ public IGameProcess StartGameProcess(IFileInfo executable, GameProcessInfo proce { var arguments = ArgumentCommandLineBuilder.BuildCommandLine(processInfo.Arguments); - _logger?.LogDebug( - $"Starting game '{processInfo.Game}' with '{processInfo.BuildType}' configuration and with launch arguments '{arguments}'"); + _logger?.LogDebug("Starting game '{Process}' with '{BuildType}' configuration and with launch arguments '{Args}'", processInfo.Game, processInfo.BuildType, arguments); var processStartInfo = new ProcessStartInfo(executable.FullName) { diff --git a/src/PG.StarWarsGame.Infrastructure/PG.StarWarsGame.Infrastructure.csproj b/src/PG.StarWarsGame.Infrastructure/PG.StarWarsGame.Infrastructure.csproj index e29b34f2..491971db 100644 --- a/src/PG.StarWarsGame.Infrastructure/PG.StarWarsGame.Infrastructure.csproj +++ b/src/PG.StarWarsGame.Infrastructure/PG.StarWarsGame.Infrastructure.csproj @@ -1,4 +1,4 @@ - + netstandard2.0;netstandard2.1 PG.StarWarsGame.Infrastructure @@ -22,10 +22,10 @@ true - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -35,9 +35,10 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + + \ No newline at end of file diff --git a/src/PG.StarWarsGame.Infrastructure/Services/Detection/Games/CompositeGameDetector.cs b/src/PG.StarWarsGame.Infrastructure/Services/Detection/Games/CompositeGameDetector.cs index 038e9bbf..0634c9b8 100644 --- a/src/PG.StarWarsGame.Infrastructure/Services/Detection/Games/CompositeGameDetector.cs +++ b/src/PG.StarWarsGame.Infrastructure/Services/Detection/Games/CompositeGameDetector.cs @@ -56,7 +56,7 @@ public GameDetectionResult Detect(GameType gameType, params ICollection protected override GameLocationData FindGameLocation(GameType gameType) { - Logger?.LogTrace($"Searching for game {gameType} at directory: {_directory}"); + Logger?.LogTrace("Searching for game {GameType} at directory: {DirectoryInfo}", gameType, _directory); return !MinimumGameFilesExist(gameType, _directory) ? GameLocationData.NotInstalled : new GameLocationData(_directory); } } \ No newline at end of file diff --git a/src/PG.StarWarsGame.Infrastructure/Services/Detection/Games/GameDetectorBase.cs b/src/PG.StarWarsGame.Infrastructure/Services/Detection/Games/GameDetectorBase.cs index c46285fa..8dafee05 100644 --- a/src/PG.StarWarsGame.Infrastructure/Services/Detection/Games/GameDetectorBase.cs +++ b/src/PG.StarWarsGame.Infrastructure/Services/Detection/Games/GameDetectorBase.cs @@ -76,7 +76,7 @@ public GameDetectionResult Detect(GameType gameType, params ICollection FindMods(IGame game) throw new ArgumentNullException(nameof(game)); if (!game.Exists()) throw new GameException("The game does not exist"); - _logger?.LogDebug($"Searching mods for game '{game}'"); + _logger?.LogDebug("Searching mods for game '{Game}'", game); return GetNormalMods(game).Union(GetWorkshopsMods(game)); } @@ -40,13 +40,13 @@ public IEnumerable FindMods(IGame game, IDirectoryInfo dir throw new GameException($"The game '{game}' does not exist"); var modLocationKind = GetModLocationKind(game, directory); - _logger?.LogTrace($"Searching mods with at location '{directory.FullName}' of location kind '{modLocationKind}' for game '{game}'"); + _logger?.LogTrace("Searching mods with at location '{Directory}' of location kind '{Kind}' for game '{Game}'", directory.FullName, modLocationKind, game); return GetModsFromDirectory(directory, modLocationKind, game.Type); } private IEnumerable GetNormalMods(IGame game) { - _logger?.LogTrace($"Searching normal mods for game '{game}'"); + _logger?.LogTrace("Searching normal mods for game '{Game}'", game); return GetAllModsFromContainerPath(game.ModsLocation, ModReferenceBuilder.ModLocationKind.GameModsDirectory, game.Type); } @@ -55,7 +55,7 @@ private IEnumerable GetWorkshopsMods(IGame game) if (game.Platform != GamePlatform.SteamGold) return []; - _logger?.LogTrace($"Searching Steam Workshop mods for game '{game}'"); + _logger?.LogTrace("Searching Steam Workshop mods for game '{Game}'", game); return GetAllModsFromContainerPath(_steamHelper.GetWorkshopsLocation(game), ModReferenceBuilder.ModLocationKind.SteamWorkshops, game.Type); } @@ -81,7 +81,7 @@ private IEnumerable GetModsFromDirectory( if (locationKind == ModReferenceBuilder.ModLocationKind.SteamWorkshops && !_steamHelper.ToSteamWorkshopsId(modDirectory.Name, out _)) yield break; - _logger?.LogTrace($"Searching for mods at location '{modDirectory.FullName}'"); + _logger?.LogTrace("Searching for mods at location '{Location}'", modDirectory.FullName); ModinfoFinderCollection modinfoFiles; modinfoFiles = ModinfoFileFinder.FindModinfoFiles(modDirectory); @@ -90,7 +90,7 @@ private IEnumerable GetModsFromDirectory( { if (_gameTypeResolver.IsDefinitelyNotCompatibleToGame(modRef, requestedGameType)) { - _logger?.LogTrace($"Skipping mod reference '{modRef.ModReference}' because it is not compatible to '{requestedGameType}'"); + _logger?.LogTrace("Skipping mod reference '{ModRef}' because it is not compatible to '{GameType}'", modRef.ModReference, requestedGameType); continue; } yield return modRef; diff --git a/src/PG.StarWarsGame.Infrastructure/Services/Detection/Mods/ModGameTypeResolver.cs b/src/PG.StarWarsGame.Infrastructure/Services/Detection/Mods/ModGameTypeResolver.cs index 71e08354..5ace74a3 100644 --- a/src/PG.StarWarsGame.Infrastructure/Services/Detection/Mods/ModGameTypeResolver.cs +++ b/src/PG.StarWarsGame.Infrastructure/Services/Detection/Mods/ModGameTypeResolver.cs @@ -41,9 +41,9 @@ public bool TryGetGameType(DetectedModReference modInformation, out ReadOnlyFrug { if (modInformation == null) throw new ArgumentNullException(nameof(modInformation)); - Logger?.LogTrace($"Try getting game type for '{modInformation.ModReference.Identifier}'"); + Logger?.LogTrace("Try getting game type for '{Id}'", modInformation.ModReference.Identifier); var result = TryGetGameTypeCore(modInformation, out gameTypes); - Logger?.LogDebug($"Detected game types '{modInformation.ModReference.Identifier}': Success: {result}; Types: [{string.Join("", gameTypes)}]"); + Logger?.LogDebug("Detected game types '{Id}': Success: {Result}; Types: [{Types}]", modInformation.ModReference.Identifier, result, string.Join("", gameTypes)); return result; } @@ -67,7 +67,7 @@ public virtual bool TryGetGameType(IModinfo? modinfo, out ReadOnlyFrugalList public bool IsDefinitelyNotCompatibleToGame(DetectedModReference modInformation, GameType expectedGameType) { - Logger?.LogTrace($"Checking if '{modInformation.ModReference.Identifier}' is not compatible to {expectedGameType}."); + Logger?.LogTrace("Checking if '{Id}' is not compatible to {GameType}.", modInformation.ModReference.Identifier, expectedGameType); // If the type resolver was unable to find the type, we have to assume that the current mod matches to the game. // Otherwise, we'd produce false negatives. Only if the resolver was able to determine a result, we use that finding. return TryGetGameType(modInformation, out var gameTypes) && !gameTypes.Contains(expectedGameType); @@ -76,7 +76,7 @@ public bool IsDefinitelyNotCompatibleToGame(DetectedModReference modInformation, /// public bool IsDefinitelyNotCompatibleToGame(IModinfo? modinfo, GameType expectedGameType) { - Logger?.LogTrace($"Checking if modinfo '{modinfo?.Name}' is not compatible to {expectedGameType}."); + Logger?.LogTrace("Checking if modinfo '{Name}' is not compatible to {GameType}.", modinfo?.Name, expectedGameType); // If the type resolver was unable to find the type, we have to assume that the current mod matches to the game. // Otherwise, we'd produce false negatives. Only if the resolver was able to determine a result, we use that finding. return TryGetGameType(modinfo, out var gameTypes) && !gameTypes.Contains(expectedGameType); diff --git a/src/PG.StarWarsGame.Infrastructure/Services/Detection/Mods/OfflineModGameTypeResolver.cs b/src/PG.StarWarsGame.Infrastructure/Services/Detection/Mods/OfflineModGameTypeResolver.cs index f6274726..cfb2fd01 100644 --- a/src/PG.StarWarsGame.Infrastructure/Services/Detection/Mods/OfflineModGameTypeResolver.cs +++ b/src/PG.StarWarsGame.Infrastructure/Services/Detection/Mods/OfflineModGameTypeResolver.cs @@ -46,14 +46,14 @@ protected internal override bool TryGetGameTypeCore(DetectedModReference modInfo if (detector.Detect(GameType.Foc, GamePlatform.Undefined).Installed) { - Logger?.LogTrace($"{modInformation.ModReference} is located in FoC's Mods directory."); + Logger?.LogTrace("{ModRef} is located in FoC's Mods directory.", modInformation.ModReference); gameTypes = new ReadOnlyFrugalList(GameType.Foc); return true; } if (detector.Detect(GameType.Eaw, GamePlatform.Undefined).Installed) { - Logger?.LogTrace($"{modInformation.ModReference} is located in EaW's Mods directory."); + Logger?.LogTrace("{ModRef} is located in EaW's Mods directory.", modInformation.ModReference); gameTypes = new ReadOnlyFrugalList(GameType.Eaw); return true; } diff --git a/src/PG.StarWarsGame.Infrastructure/Services/Detection/Mods/OnlineModGameTypeResolver.cs b/src/PG.StarWarsGame.Infrastructure/Services/Detection/Mods/OnlineModGameTypeResolver.cs index 57674afd..b0c6ffd2 100644 --- a/src/PG.StarWarsGame.Infrastructure/Services/Detection/Mods/OnlineModGameTypeResolver.cs +++ b/src/PG.StarWarsGame.Infrastructure/Services/Detection/Mods/OnlineModGameTypeResolver.cs @@ -37,7 +37,7 @@ private bool GetGameTypeFromSteamPage(string steamIdValue, out ReadOnlyFrugalLis if (!_steamGameHelpers.ToSteamWorkshopsId(steamIdValue, out var steamId)) return false; - Logger?.LogTrace($"Getting steam tags from Steam's webpage for mod '{steamId}'"); + Logger?.LogTrace("Getting steam tags from Steam's webpage for mod '{SteamId}'", steamId); var webPage = _steamWebpageDownloader.GetSteamWorkshopsPageHtmlAsync(steamId, CultureInfo.InvariantCulture) .GetAwaiter().GetResult(); diff --git a/src/PG.StarWarsGame.Infrastructure/Services/Name/Mods/ModNameResolverBase.cs b/src/PG.StarWarsGame.Infrastructure/Services/Name/Mods/ModNameResolverBase.cs index 5768f372..7f66290c 100644 --- a/src/PG.StarWarsGame.Infrastructure/Services/Name/Mods/ModNameResolverBase.cs +++ b/src/PG.StarWarsGame.Infrastructure/Services/Name/Mods/ModNameResolverBase.cs @@ -44,11 +44,11 @@ public string ResolveName(DetectedModReference detectedMod, CultureInfo culture) if (detectedMod.ModReference.Type == ModType.Virtual) throw new NotSupportedException("Virtual mods are not supported."); - Logger?.LogTrace($"Resolving name for '{detectedMod}' with culture '{culture.EnglishName}'"); + Logger?.LogTrace("Resolving name for '{ModRef}' with culture '{Culture}'", detectedMod, culture.EnglishName); var name = detectedMod.Modinfo is not null ? detectedMod.Modinfo.Name : ResolveCore(detectedMod, culture); if (string.IsNullOrEmpty(name)) - Logger?.LogWarning($"Resolved null or empty name for '{detectedMod.ModReference.Identifier}'"); + Logger?.LogWarning("Resolved null or empty name for '{ModRef}'", detectedMod.ModReference.Identifier); return name; } diff --git a/src/PG.StarWarsGame.Infrastructure/Services/Name/Mods/OnlineWorkshopNameResolver.cs b/src/PG.StarWarsGame.Infrastructure/Services/Name/Mods/OnlineWorkshopNameResolver.cs index 5500b126..91514eba 100644 --- a/src/PG.StarWarsGame.Infrastructure/Services/Name/Mods/OnlineWorkshopNameResolver.cs +++ b/src/PG.StarWarsGame.Infrastructure/Services/Name/Mods/OnlineWorkshopNameResolver.cs @@ -55,14 +55,14 @@ protected internal override string ResolveCore(DetectedModReference detectedMod, if (modsWorkshopWebpage == null) { - Logger?.LogTrace($"Unable to download website for Steam ID '{modId}'."); + Logger?.LogTrace("Unable to download website for Steam ID '{ModId}'.", modId); return null; } var node = modsWorkshopWebpage.DocumentNode.SelectSingleNode("//div[contains(@class, 'workshopItemTitle')]"); if (node is null) { - Logger?.LogTrace($"Unable to find the item title on website for Steam ID '{modId}',"); + Logger?.LogTrace("Unable to find the item title on website for Steam ID '{ModId}',", modId); return null; } return node.InnerHtml; diff --git a/test/AET.SteamAbstraction.Test/AET.SteamAbstraction.Test.csproj b/test/AET.SteamAbstraction.Test/AET.SteamAbstraction.Test.csproj index daf3d646..4525e445 100644 --- a/test/AET.SteamAbstraction.Test/AET.SteamAbstraction.Test.csproj +++ b/test/AET.SteamAbstraction.Test/AET.SteamAbstraction.Test.csproj @@ -1,26 +1,26 @@ - + AET.SteamAbstraction.Test - net9.0 - $(TargetFrameworks);net48 + net10.0 + $(TargetFrameworks);net481 false true - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/test/AET.SteamAbstraction.Testing/AET.SteamAbstraction.Testing.csproj b/test/AET.SteamAbstraction.Testing/AET.SteamAbstraction.Testing.csproj index 11eb9e83..893861a4 100644 --- a/test/AET.SteamAbstraction.Testing/AET.SteamAbstraction.Testing.csproj +++ b/test/AET.SteamAbstraction.Testing/AET.SteamAbstraction.Testing.csproj @@ -1,12 +1,12 @@ - + AET.SteamAbstraction.TestingUtilities - net9.0 - $(TargetFrameworks);net48 + net10.0 + $(TargetFrameworks);net481 false false @@ -16,16 +16,16 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + runtime; build; native; contentfiles; analyzers; buildtransitive all @@ -33,9 +33,9 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all - - - + + + diff --git a/test/PG.StarWarsGame.Infrastructure.Clients.Steam.Test/PG.StarWarsGame.Infrastructure.Clients.Steam.Test.csproj b/test/PG.StarWarsGame.Infrastructure.Clients.Steam.Test/PG.StarWarsGame.Infrastructure.Clients.Steam.Test.csproj index 14d503b8..96b4e4eb 100644 --- a/test/PG.StarWarsGame.Infrastructure.Clients.Steam.Test/PG.StarWarsGame.Infrastructure.Clients.Steam.Test.csproj +++ b/test/PG.StarWarsGame.Infrastructure.Clients.Steam.Test/PG.StarWarsGame.Infrastructure.Clients.Steam.Test.csproj @@ -1,27 +1,27 @@ - + PG.StarWarsGame.Infrastructure.Clients.Steam.Test - net9.0 - $(TargetFrameworks);net48 + net10.0 + $(TargetFrameworks);net481 false true - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - + + + + - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/test/PG.StarWarsGame.Infrastructure.Test/PG.StarWarsGame.Infrastructure.Test.csproj b/test/PG.StarWarsGame.Infrastructure.Test/PG.StarWarsGame.Infrastructure.Test.csproj index 4cc8b715..869308bf 100644 --- a/test/PG.StarWarsGame.Infrastructure.Test/PG.StarWarsGame.Infrastructure.Test.csproj +++ b/test/PG.StarWarsGame.Infrastructure.Test/PG.StarWarsGame.Infrastructure.Test.csproj @@ -1,28 +1,28 @@ - + PG.StarWarsGame.Infrastructure.Test - net9.0 - $(TargetFrameworks);net48 + net10.0 + $(TargetFrameworks);net481 false true - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + - + - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/test/PG.StarWarsGame.Infrastructure.Testing/PG.StarWarsGame.Infrastructure.Testing.csproj b/test/PG.StarWarsGame.Infrastructure.Testing/PG.StarWarsGame.Infrastructure.Testing.csproj index 58ba8578..51c7d4e4 100644 --- a/test/PG.StarWarsGame.Infrastructure.Testing/PG.StarWarsGame.Infrastructure.Testing.csproj +++ b/test/PG.StarWarsGame.Infrastructure.Testing/PG.StarWarsGame.Infrastructure.Testing.csproj @@ -1,12 +1,12 @@ - + PG.StarWarsGame.Infrastructure.TestingUtilities - net9.0 - $(TargetFrameworks);net48 + net10.0 + $(TargetFrameworks);net481 false false @@ -16,16 +16,16 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + runtime; build; native; contentfiles; analyzers; buildtransitive all @@ -33,9 +33,9 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all - - - + + + diff --git a/test/PG.TestingUtilities/PG.TestingUtilities.csproj b/test/PG.TestingUtilities/PG.TestingUtilities.csproj index 741347ab..16fc0df1 100644 --- a/test/PG.TestingUtilities/PG.TestingUtilities.csproj +++ b/test/PG.TestingUtilities/PG.TestingUtilities.csproj @@ -1,8 +1,8 @@ - + - net9.0 - $(TargetFrameworks);net48 + net10.0 + $(TargetFrameworks);net481 false false @@ -12,9 +12,9 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive