dotnet / dotnet/wpf

.NET Framework 4.8 WPF - Setting MainWindow.Language may cause app not displaying

Open
#3,761 0 comments 0 reactions 0 assignees View on GitHub
.NET Framework Bug
Dominant language
C#
Stars
7.7k
Forks
1.3k
Avg merge
1d 11h
Merged PRs (30d)
61

Description

_This issue has been moved from [a ticket on Developer Community](https://developercommunity2.visualstudio.com/t/NET-Framework-48-WPF---Setting-MainWin/833881)._

---
I'm building a .NET Framework 4.8 WPF app. I have this code in the main window `Loaded` event,

`this. Language = System.Windows.Markup.XmlLanguage.GetLanguage(System.Threading.Thread.CurrentThread.CurrentUICulture.IetfLanguageTag);`

and on certain PCs/laptops (it doesn't happen on all PCs), the app will run and the main window displayed fine on the first run. If I exit the app and re-run the app, the main window will not appear anymore but the app is running (from Task Manager). Terminating and re-running it won't resolve the issue. The only possible workaround is to restart Windows and then the app main window will be displayed again.

If I remove the line stated above, everything works fine.

---
### Original Comments

#### Feedback Bot on 11/26/2019, 05:01 PM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

#### Feedback Bot on 1/3/2020, 09:36 AM:

I have detected that for the last 35 days, this issue didn't have much product team activity and a very small amount of new votes or comments. Based on this, its severity, and affected area, it’s my experience that this issue is very unlikely to be fixed.

---
### Original Solutions
(no solutions)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.