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.

Add .Net Core 3 support

See original GitHub issue

I got a closed source project where i got a wpf app that uses magick.net to load and display images in xaml by loading them in the background and converting to something wpf can display with

                var data = default(byte[]); // not actual initialization logic, but simply for showing the datatype
                using (var img = new MagickImage(data))
                {
                    source = img.ToBitmapSource();
                    source.Freeze();
                }

When i migrated that project to netcoreapp3.0, i noticed, that that img.ToBitmapSource(); is not available to me anymore, when using Magick.NET-Q8-AnyCPU with version 7.11.1.

I imagine, adding the appropriate preprocessor directive to MagickImage.cs might already be enough to fix my issue.

This fix would add the .net core 3 sdk (preview) as dependency and require the usage of Visual Studio 2019 (preview) or rather the corresponding msbuild version to be installed locally. So i do understand if this isnt going to happen right away.

I am happy to provide further details when required.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
dlemstracommented, Jun 10, 2020

The ToBitmap and ToBitmapSource methods have been moved to new separate libraries called Magick.NET.SystemDrawing and Magick.NET.SystemWindowsMedia. The Magick.NET.SystemDrawing library has support for netstandard20. But that has not been done for the Magick.NET.SystemWindowsMedia library. I don’t know which dependency I need to add to make it work. Only targetting netcoreapp3.0 does not seem to work.

0reactions
Insirecommented, Jun 10, 2020

I just tried it and used

        <TargetFrameworks>netcoreapp3.1</TargetFrameworks>

... 

        <PackageReference Include="Magick.NET-Q8-AnyCPU" Version="7.19.0" />
        <PackageReference Include="Magick.NET.SystemWindowsMedia" Version="1.0.1" />

which worked as expected in a .net core app using

        using ImageMagick;

        private static BitmapSource GetImage(string path)
        {
            using (var stream = File.OpenRead(path))
            using (var img = new MagickImage(stream))
            {
                var source = img.ToBitmapSource();
                source.Freeze();

                return source;
            }
        }

Read more comments on GitHub >

github_iconTop Results From Across the Web

.NET and .NET Core official support policy
But the actual end of support day is the closest Patch Tuesday starting that date, which is November 12, 2024. ASP.NET Core 2.1...
Read more >
Install .NET Core, ASP.NET Core
NET Core can be installed in two ways: By installing Visual Studio 2017/2019 or by installing .NET Core Runtime or SDK. .NET Core...
Read more >
How to target .NET core 3 on visual studio 2022
I just install visual studio 2022. I can target .NET 5.0 and .NET 6.0. Is it possible to add an older version, let's...
Read more >
Enable .NET Core 3 in Visual Studio 2017 (15.9) - YouTube
UPDATE: This video no longer applies to . NET Core 3 development. Visual Studio 2019 is now required for . NET Core 3...
Read more >
Microsoft Announces End of Support Date for .NET Core 3.1
Microsoft announced today that .NET Core 3.1, a predecessor to .NET 5 and 6, will reach its end of support on December 13,...
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