Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7020173
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:17:02+00:00 2026-05-27T23:17:02+00:00

Fairly simple question I’m hoping but I’ve not managed to find an answer yet

  • 0

Fairly simple question I’m hoping but I’ve not managed to find an answer yet on Google that works…

I’m working in a C# testing context, and am referencing a managed C++ DLL which then references normal C++ assemblies. When I try to run my test I get a FileNotFoundException that doesn’t give me any details on the file it was unable to find.

System.IO.FileNotFoundException: The specified module could not be
found. (Exception from HRESULT: 0x8007007E)

I’ve done some checking with ProcMon and found it’s trying to load up one of the C++ DLL’s but it’s probing all the standard places (C:\Windows, C:\Windows\System etc..). Is there a way I can redirect this to include an additional folder where all our binaries are built to?

I’m guessing there’s something on the AppDomain but I’ve not quite figured out which property to use, which will work.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T23:17:03+00:00Added an answer on May 27, 2026 at 11:17 pm

    As per Hans suggestions:

    [DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
    [return: MarshalAs(UnmanagedType.Bool)]
    static extern bool SetDllDirectory(string lpPathName);
    
    SetDllDirectory(@"C:\SomeDir");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've a question that should be fairly simple, but I have yet to find
Fairly simple question really, yet I can't find a clear answer on google for
I actually have a fairly simple question but I'm unable to find an answer
fairly simple question I think that I couldn't find the answer to in the
This may be a fairly simple question but it's just not working for me
A fairly simple question for which I have a guess, but I can't find
This should be a fairly simple question to answer, but I am interested to
This is a fairly simple question, but it's one I can't find a firm
I have a fairly simple question, but I can't seem to find a simple
I know this must be a fairly simple question, but I haven't managed to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.