Monthly Archives: Oktober 2024
Logging Structured Message Templates selbst verwenden
Um selbst Strukturierte Messages Templates wie im Logging zu verwenden, kann man folgende Annotations nutzen:
1 2 3 4 5 6 7 8 |
[MessageTemplateFormatMethod("message")] public void Error<TArgument1, TArgument2, TArgument3>([Localizable(false)][StructuredMessageTemplate] string message, TArgument1 argument1, TArgument2 argument2, TArgument3 argument3) { if (IsErrorEnabled) { WriteToTargets(LogLevel.Error, message, new object[3] { argument1, argument2, argument3 }); } } |
0
Discord Installation „a fatal javascript error occurred“
Das war die einzige Lösung, die funktionierte, um Discord zu installieren über choco: I have a problem with discord, and its no the logo. : r/discordapp (reddit.com) Dazu das Powershell-Script. Ausprobiert und getestet.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# Get the Local AppData path dynamically using %LocalAppData% environment variable $localAppData = [System.Environment]::GetFolderPath('LocalApplicationData') $discordPath = Join-Path $localAppData "Discord" # Navigate to the Discord folder Set-Location -Path $discordPath # Delete the installer.db file if it exists $installerDbPath = Join-Path $discordPath "installer.db" if (Test-Path $installerDbPath) { Remove-Item $installerDbPath -Force Write-Host "Deleted installer.db file from $discordPath" } else { Write-Host "No installer.db file found to delete." } # Get the folder that starts with "app-" $appVersionFolder = Get-ChildItem -Path $discordPath | Where-Object { $_.Name -like 'app-*' } | Select-Object -First 1 # Check if the app version folder was found if ($appVersionFolder -ne $null) { $sourceDbPath = Join-Path $appVersionFolder.FullName "installer.db" # Check if the installer.db file exists in the app version folder if (Test-Path $sourceDbPath) { # Copy the installer.db file to the Discord folder Copy-Item -Path $sourceDbPath -Destination $discordPath -Force Write-Host "Copied installer.db from $($appVersionFolder.Name) to $discordPath" } else { Write-Host "No installer.db file found in $($appVersionFolder.Name)" } } else { Write-Host "No app version folder found." } |
Login