Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

444
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!