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

349
Visualizações
Is it possible to work with a .NET 4.8 Library from .NET 6?

I need to reference a proprietary-client library that only works with .NET 4.8, there is no other option, this is a very narrow vendor library and we have to use it with .NET 48.

The new app that is being developed is a service application and will need to be maintained in the long term. And it's ok for this app to be installed on windows only. But we would like the application to benefit from .NET 6, while being able to use the .NET 4.8 client library.

So my question is : what would/could be a good solution that:

  1. respects that I need some code in 4.8 to work with that library.
  2. leverages .NET 6 and future enhancements

Thanks for your help!

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

0

Yes, it is possible to have a client written in .NET Framework 4.8 and a server in .NET Core 6. It's possible to have a client and a server written in different programming languages as well, so there's no reason that your use case wouldn't be possible. However, it's not possible to reference a .NET Core assembly from a .NET Framework assembly.

over 4 years ago · Santiago Trujillo Relatório

0

Yes you can reference .NET 4.8 assembly from .NET 6. However, there are no guarantees it will work as expected. It will work only if it does not use any APIs which are not present in .NET 6 (or rather .NET Standard version supported by .NET 4.8), and if APIs it uses did not have breaking (for that application logic) changes.

You can easily test it by creating .NET 4.8 library with something like this:

public class Test
{
    public static void OldNet()
    {
        Console.WriteLine("Hello from old .NET");
    }
}

Then reference it from .NET 6 and call:

 OldNet4.Test.OldNet();

Run and it will print "Hello from old .NET" no problem.

However if you for example use Thread.Abort in that old .NET 4.8 library - when running on .NET 6 it will not abort the target thread but instead will throw PlatformNotSupportedException, which is an example of breaking change. If it calls missing api, then it will throw TypeNotFound or similar exceptions.

So the end result depends on the library being referenced.

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