Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

315
Visualizações
NuGet System.Drawing.Common .NET 6 CA1416 This call site is reachable on all platforms. 'Image.FromStream(Stream)' is only supported on: 'windows'

Upgrading NuGet System.Drawing.Common to 6.0.0 causes the following error:

CA1416 This call site is reachable on all platforms. 'Image.FromStream(Stream)' is only supported on: 'windows'.

https://www.nuget.org/packages/System.Drawing.Common/

The affected code is the following:

var drawingImage = System.Drawing.Image.FromStream(memstr);

We use the library to access the method GetThumbnailImage.

public byte[] GetThumbnailBytes(byte[] imageBytes)
{
    var thumbnailBytes = Array.Empty<byte>();

    using (MemoryStream memstr = new MemoryStream(imageBytes))
    {
        var drawingImage = System.Drawing.Image.FromStream(memstr);
        var thumbnailSize = GetThumbnailSize(drawingImage);

        var thumbnail = drawingImage.GetThumbnailImage(thumbnailSize.Width, thumbnailSize.Height, null, IntPtr.Zero);

        var ms = thumbnail.ToStream(drawingImage.RawFormat);

        thumbnailBytes = ms.ReadFully();
    }

    return thumbnailBytes;
}

We only host the application on Azure so targeting Windows is fine but replacing GetThumbnailImage is acceptable as well.

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

This has been an long open issue

I have got around it by editing my shared assembly info (not autogenerated) with

#if NET6_0
[assembly: System.Runtime.Versioning.SupportedOSPlatform("windows7.0")]
#endif
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda