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

Can't run published apps on Windows 7 #19118

Open
YueLengM opened this issue Dec 24, 2024 · 2 comments
Open

Can't run published apps on Windows 7 #19118

YueLengM opened this issue Dec 24, 2024 · 2 comments
Labels
difficulty/medium 🤔 Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUI kind/bug Something isn't working project/resources 🈷️ Categorizes an issue or PR as relevant to resources and localization (Resources, Assets,...)

Comments

@YueLengM
Copy link

Current behavior

Can't run published app on windows 7.
Event viewer shows the following log

Application: Counter.exe
CoreCLR Version: 8.0.1124.51707
.NET Version: 8.0.11
Description: The process was terminated due to an unhandled exception.
Exception Info: System.TypeInitializationException: The type initializer for 'Windows.Globalization.ApplicationLanguages' threw an exception.
 ---> System.DllNotFoundException: Unable to load DLL 'winlangdb.dll' or one of its dependencies: The specified module could not be found.  (0x8007007E)
   at Windows.System.UserProfile.GlobalizationPreferences.NativeMethods.EnsureLanguageProfileExists()
   at Windows.System.UserProfile.GlobalizationPreferences.GetWinUserLanguageList() in /__w/1/s/src/Uno.UWP/System/UserProfile/GlobalizationPreferences.cs:line 33
   at Windows.System.UserProfile.GlobalizationPreferences.get_Languages() in /__w/1/s/src/Uno.UWP/System/UserProfile/GlobalizationPreferences.cs:line 26
   at Windows.Globalization.ApplicationLanguages.ApplyLanguages() in /__w/1/s/src/Uno.UWP/Globalization/ApplicationLanguages.cs:line 157
   at Windows.Globalization.ApplicationLanguages..cctor() in /__w/1/s/src/Uno.UWP/Globalization/ApplicationLanguages.cs:line 63
   --- End of inner exception stack trace ---
   at Windows.Globalization.ApplicationLanguages.ApplyCulture() in /__w/1/s/src/Uno.UWP/Globalization/ApplicationLanguages.cs:line 68
   at Microsoft.UI.Xaml.Application..ctor() in /__w/1/s/src/Uno.UI/UI/Xaml/Application.cs:line 95
   at Counter.App..ctor() in C:\Users\Administrator\source\repos\Uno.Samples-master\reference\Counter\XAML-MVVM\Counter\App.xaml.cs:line 13
   at Counter.Program.<>c.<Main>b__0_0() in C:\Users\Administrator\source\repos\Uno.Samples-master\reference\Counter\XAML-MVVM\Counter\Platforms\Desktop\Program.cs:line 13
   at Uno.UI.Runtime.Skia.Wpf.WpfHost.<StartApp>g__CreateApp|20_0(ApplicationInitializationCallbackParams _)
   at Microsoft.UI.Xaml.Application.StartPartial(ApplicationInitializationCallback callback) in /__w/1/s/src/Uno.UI/UI/Xaml/Application.skia.cs:line 85
   at Microsoft.UI.Xaml.Application.Start(ApplicationInitializationCallback callback) in /__w/1/s/src/Uno.UI/UI/Xaml/Application.cs:line 261
   at Uno.UI.Runtime.Skia.Wpf.WpfHost.StartApp()
   at Uno.UI.Runtime.Skia.Wpf.WpfHost.RunLoop()
   at Uno.UI.Runtime.Skia.SkiaHost.RunCore()
   at Uno.UI.Runtime.Skia.SkiaHost.Run()
   at Counter.Program.Main(String[] args) in C:\Users\Administrator\source\repos\Uno.Samples-master\reference\Counter\XAML-MVVM\Counter\Platforms\Desktop\Program.cs:line 12

Expected behavior

No response

How to reproduce it (as minimally and precisely as possible)

  • Download Counter\XAML-MVVM sample
  • Publish using the CLI dotnet publish -f net8.0-desktop -r win-x64 -p:SelfContained=true
  • Try running it on Windows 7 VM

Workaround

No response

Works on UWP/WinUI

None

Environment

Uno.UI / Uno.UI.WebAssembly / Uno.UI.Skia

NuGet package version(s)

No response

Affected platforms

No response

IDE

Visual Studio 2022

IDE version

No response

Relevant plugins

No response

Anything else we need to know?

No response

@YueLengM YueLengM added difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification labels Dec 24, 2024
@DevTKSS
Copy link
Contributor

DevTKSS commented Dec 31, 2024

@YueLengM
I am not from Team, but participated in a Discussion few Weeks ago, where we asked about wpf for .net Framework compartiblity and the Windows 7 topic you maybe talking about here (?) might have be answered there also from jerome. Could you please lookup that Discussion to check if that already provides a answer to your issue here?
#18764

Honestly I did not fully understand what he meant by the .net 8 can be used for building to windows 7 because his last answer could mean, its just kind of supported, but more likly not longer activly supported, like some "If you are lucky it will run" but thats just my understandment, which might be wrong!

@YueLengM
Copy link
Author

The exception log is from .net so I believe that .net 8 should work on Windows 7. But uno is using a dll that is not available on Windows 7.

#if __SKIA__
private static string[] GetWinUserLanguageList()
{
if (NativeMethods.EnsureLanguageProfileExists() >= 0)
{
const char Delimiter = ';';
if (NativeMethods.GetUserLanguages(Delimiter, out var handle) >= 0)
{
var languages = MarshalString.FromAbi(handle).Split(Delimiter);
MarshalString.DisposeAbi(handle);
return languages;
}
}
return Array.Empty<string>();
}
private static class NativeMethods
{
[DllImport("winlangdb.dll", CharSet = CharSet.Unicode, SetLastError = true)]
public static extern int EnsureLanguageProfileExists();

@MartinZikmund MartinZikmund added project/resources 🈷️ Categorizes an issue or PR as relevant to resources and localization (Resources, Assets,...) difficulty/medium 🤔 Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUI and removed triage/untriaged Indicates an issue requires triaging or verification difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. labels Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty/medium 🤔 Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUI kind/bug Something isn't working project/resources 🈷️ Categorizes an issue or PR as relevant to resources and localization (Resources, Assets,...)
Projects
None yet
Development

No branches or pull requests

3 participants