question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

.NET 6 Support on Linux

See original GitHub issue

Describe the bug .MSG files are not able to be read/parsed on .NET 6 when the code is running on linux.

One of the .NET 6 breaking changes is that it now no longer supports the system.drawing.common on linux. (see .net 6 breaking change here)

The exception you get is: Error Message: System.TypeInitializationException : The type initializer for 'Gdip' threw an exception. ---- System.PlatformNotSupportedException : System.Drawing.Common is not supported on non-Windows platforms. See https://aka.ms/systemdrawingnonwindows for more information. Stack Trace: at System.Drawing.SafeNativeMethods.Gdip.GdipGetGenericFontFamilySansSerif(IntPtr& fontfamily)

For .NET 5, you are able to install the linux package libgdiplus to have it work, but this no longer is a workaround.

To Reproduce Steps to reproduce the behavior:

  1. Try processing a .msg email in a .NET 6 application on linux

Expected behavior The .msg email will be able to be parsed.

Desktop (please complete the following information):

  • OS: Linux
  • .NET 6

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:33 (18 by maintainers)

github_iconTop GitHub Comments

1reaction
Sicos1977commented, Aug 22, 2023

Always find it funy (in a good way) that I have so much contact with people that work for Microsoft and use MSGReader (that is build by me that does not work for Microsoft)… because Microsoft invented the MSG format

1reaction
Sicos1977commented, Aug 22, 2023

If there is still an issue than please open a new issue instead of reusing this one. I always get lost in issues that are already closed.

I just published version 5.4.0 that should get rid of the System.Drawing.Common problem on Linux because it is now only tied to the .NET 4.6.2 framework that only works on Windows

Read more comments on GitHub >

github_iconTop Results From Across the Web

Install .NET on Linux distributions
This article details how to install .NET on various Linux distributions either manually, via a package manager, or via a container. Manual ...
Read more >
Download .NET 6.0 (Linux, macOS, and Windows) - Dot.net
NET 6.0 downloads for Linux, macOS, and Windows. .NET is a free, ... NET Desktop Runtime 6.0.21; Language support: C# 10.0: F# 6.0:...
Read more >
NET 6 Supported OS Versions
NET 6 is supported in the x64 emulator on Windows 11 Arm64. Linux. OS, Version, Architectures, Lifecycle. Alpine Linux, 3.13+, x64, Arm64 ...
Read more >
.NET 6 comes to Ubuntu 22.04 • The Register
.NET 6 is Microsoft's cross-platform toolchain for building apps to run on multiple platforms, including Windows, Linux, macOS, and mobile OSes.
Read more >
Getting started with .NET on RHEL 8 .NET 6.0
.NET is available on Red Hat Enterprise Linux (RHEL) and OpenShift Container ... NET 6.0 is supported on RHEL 7, RHEL 8, RHEL...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found