[SVGThumbnails]Fix hanging loop and add logs (#31116)

This commit is contained in:
Jaime Bernardo
2024-01-24 15:27:42 +00:00
committed by GitHub
parent 172db3af63
commit 6f5a59b20d
3 changed files with 7 additions and 1 deletions

View File

@@ -3,6 +3,7 @@
// See the LICENSE file in the project root for more information.
using System.Globalization;
using ManagedCommon;
namespace Microsoft.PowerToys.ThumbnailHandler.Svg
{
@@ -17,6 +18,7 @@ namespace Microsoft.PowerToys.ThumbnailHandler.Svg
public static void Main(string[] args)
{
ApplicationConfiguration.Initialize();
Logger.InitializeLogger("\\FileExplorer_localLow\\SvgThumbnails\\logs", true);
if (args != null)
{
if (args.Length == 2)

View File

@@ -7,6 +7,7 @@ using System.Reflection;
using System.Runtime.CompilerServices;
using System.Threading;
using Common.Utilities;
using ManagedCommon;
using Microsoft.Web.WebView2.Core;
using Microsoft.Web.WebView2.WinForms;
@@ -197,8 +198,10 @@ namespace Microsoft.PowerToys.ThumbnailHandler.Svg
_browser.NavigateToString(SvgContents);
}
}
catch (Exception)
catch (Exception ex)
{
Logger.LogError($"Failed running webView2Environment completed for {FilePath} : ", ex);
thumbnailDone.Set();
}
});

View File

@@ -52,5 +52,6 @@
<ProjectReference Include="..\..\..\common\GPOWrapper\GPOWrapper.vcxproj" />
<ProjectReference Include="..\..\..\common\ManagedTelemetry\Telemetry\ManagedTelemetry.csproj" />
<ProjectReference Include="..\Common\PreviewHandlerCommon.csproj" />
<ProjectReference Include="..\..\..\common\Common.UI\Common.UI.csproj" />
</ItemGroup>
</Project>