NLog randomly crashes in UWP app with Microsoft.Extensions.DependencyInjection (only when debugging)
See original GitHub issueNLog version: 4.6.7
Platform: UWP: Windows 10, version 1809(10.0; Build 17763) - Windows 10, version 1903(10.0; Build 18362) Console: .NET Core 2.2
Current NLog config (xml or C#, if relevant)
public static void AddLogger(this ServiceCollection services)
{
services.AddLogging(loggingBuilder =>
{
// configure Logging with NLog
loggingBuilder.ClearProviders();
loggingBuilder.SetMinimumLevel(Microsoft.Extensions.Logging.LogLevel.Trace);
loggingBuilder.AddNLog();
});
// UWP is very restrictive of where you can save files on the disk.
// The preferred place to do that is app's local folder.
StorageFolder folder = ApplicationData.Current.LocalFolder;
string fullPath = folder.Path + @"\Logs\${date:format=yyyy-MM-dd}.Player.log";
var config = new LoggingConfiguration();
var fileTarget = new FileTarget("App.log")
{
FileName = fullPath,
Layout = "${longdate} ${uppercase:${level}} ${message} ${exception}"
};
config.AddTarget(fileTarget);
config.AddRule(NLog.LogLevel.Debug, NLog.LogLevel.Fatal, "App.log");
LogManager.Configuration = config;
}
- What is the current result?
Sometimes it’s working. But sometimes UWP app is crashing. So random crash. With no trace, but I know it’s because of nlog.
- What is the expected result? Stable working app.
- Did you checked the Internal log? No.
- Please post full exception details (message, stacktrace, inner exceptions) I’ve created a minimal reproducible example here: https://github.com/aosyatnik/UWP_with_nLog
- Are there any workarounds? yes/no I don’t know.
- Is there a version in which it did work? I don’t think so.
- Can you help us by writing an unit test? Maybe.
Issue Analytics
- State:
- Created 4 years ago
- Comments:18 (12 by maintainers)
Top Results From Across the Web
UWP app random crash - Microsoft Q&A
Our UWP app crashes in release mode randomly. Windows event viewer shows following exception codes. Faulting module name: edgeIso.dll, ...
Read more >UWP/C# app crashes on startup when in "Release" from ...
UWP /C# app crashes on startup when in "Release" from Visual Studio, runs fine in Debug. Hi,. I've programmed a simple timer app...
Read more >UWP | XAML Brewer, by Diederik Krols
In this article we describe the process of migrating a user control from UWP to WinUI 3. The subject is the Radial Gauge...
Read more >Xamarin Archives - MSCTEK
So, I created two new apps in AppCenter, one for iOS and another for Android. AppCenter also works with Xamarin UWP and a...
Read more >What's New in NDepend
From NDepend to ILSpy: Just right click any assembly, namespace, class, method or field in NDepend or Visual Studio (with the NDepend extension...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’ll ask on microsoft side: https://developercommunity.visualstudio.com/content/problem/773519/random-systemexecutionengineexception-in-uwp-on-st.html
Thanks for helping 😃
So there is no logging enabled or whatsoever and it still crashes (sometimes)
error details until now:
it’s always 0x80131506
maybe related: https://developercommunity.visualstudio.com/content/problem/25274/systemexecutionengineexception-when-debugging.html