2

I know I'm being thick but I am having trouble implementing a new 'using' directory for my .NET Core project.

I have downloaded the necessary files for CoreCompact.System.Drawing (https://github.com/CoreCompat/CoreCompat)

I simply have no idea how to implement the folders so that I can start using this directory and subsequently use the system.drawing objects that are not supported in Core projects.

I am new to ASP.Net but have been studying C# for long enough that I don't need too detailed a guide.

Zoe
  • 27,060
  • 21
  • 118
  • 148
James Lewis
  • 69
  • 1
  • 10
  • Also, if anyone has any alternatives to a clone of system.drawing for implementation in .net core I'm open to suggestions. I am trying to work with bitmaps. – James Lewis Jun 20 '18 at 11:17
  • Is there any reason why you're using `CoreCompat.System.Drawing` and not Microsoft's `System.Drawing.Common?` – ProgrammingLlama Jun 20 '18 at 11:18
  • By the way, the `visual-studio` tag should only be used for questions pertaining to the Visual Studio application, and not code that is merely written in it. – ProgrammingLlama Jun 20 '18 at 11:19

3 Answers3

12

There's no need to use CoreCompat.System.Drawing anymore. In fact, the author says you shouldn't. The reason? Microsoft provides an official System.Drawing.Common NuGet package now.

To install:

  1. Select the Tools menu
  2. NuGet package manager
  3. Manage NuGet packages for solution
  4. Click Browse tab
  5. Search for System.Drawing.Common
  6. Select the Microsoft package
  7. Tick/check your project on the right-hand panel.
  8. Click Install
  9. Agree to the licence agreement.
ProgrammingLlama
  • 36,677
  • 7
  • 67
  • 86
1

You may need to add it as a reference to your project first. Do this by right clicking on the "References" file in your solution, and click add reference. Then press the "Browse..." Button in the bottom right of the pop up window and navigate to the desired DLL.

Zoe
  • 27,060
  • 21
  • 118
  • 148
CRoberts
  • 286
  • 1
  • 6
  • 17
0

Since System.Drawing.Common doesn't work with .NET 7 on linux any more (see https://learn.microsoft.com/en-us/dotnet/core/compatibility/core-libraries/6.0/system-drawing-common-windows-only), I'm facing problems with my 3rd party libraries still belong to System.Drawing. Unfortunately, there is no upgrade available for that 3rd-party library.

So, I'm finding myself searching for an alternative and found this reference to CoreCompat.System.Drawing as well as https://github.com/zkweb-framework/zkweb.system.drawing . Maybe it's worthy to revive those components - at least when running applications on Linux?

Jochen
  • 380
  • 1
  • 3
  • 9