Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix settings page crash on Windows 10 #1480

Merged
merged 4 commits into from
Apr 25, 2024
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions WinUIGallery/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,19 @@ public static string WinAppSdkRuntimeDetails
{
get
{
// Retrieve Windows App Runtime version info dynamically
var windowsAppRuntimeVersion =
from module in Process.GetCurrentProcess().Modules.OfType<ProcessModule>()
where module.FileName.EndsWith("Microsoft.WindowsAppRuntime.Insights.Resource.dll")
select FileVersionInfo.GetVersionInfo(module.FileName);
return WinAppSdkDetails + ", Windows App Runtime " + windowsAppRuntimeVersion.First().FileVersion;
try
{
// Retrieve Windows App Runtime version info dynamically
var windowsAppRuntimeVersion =
from module in Process.GetCurrentProcess().Modules.OfType<ProcessModule>()
where module.FileName.EndsWith("Microsoft.WindowsAppRuntime.Insights.Resource.dll")
select FileVersionInfo.GetVersionInfo(module.FileName);
return WinAppSdkDetails + ", Windows App Runtime " + windowsAppRuntimeVersion.First().FileVersion;
}
catch
{
return WinAppSdkDetails + $", Windows App Runtime {WASDK.Runtime.Version.Major}.{WASDK.Runtime.Version.Minor}";
}
}
}

Expand Down