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

445
Visualizações
Runtime path for DllImport Attribute on Linux

I'm looking for a solution for dynamically change the dll path when using DLLImport attribute under Linux. I have an if statement for checking the current OS (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)), and if the application runs on windows than I'm using the SetDllDirectory method from kernel32.dll to dynamically add a folder to the dll search path.

For Windows I have two different dlls to load based on some runtime decision. they will be located at Environment.CurrentDirectory + Drivers/Win/1/ and Environment.CurrentDirectory + Drivers/Win/2/.

For Linux, the .so will be located at Environment.CurrentDirectory + Drivers/Linux/

The dlls and so files have the exact same interface and name.

Is there an equivalent solution like SetDllDirectory for Linux under .NET 5?

Thanks

over 4 years ago · Santiago Trujillo
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