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

  • Home
  • SEARCH
  • 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 7194281
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T20:20:23+00:00 2026-05-28T20:20:23+00:00

Problem in short: How to call a function from DLL A.dll using p/invoke when

  • 0

Problem in short: How to call a function from DLL A.dll using p/invoke when A.dll depends on another SXS-lib (in my case MSVCR90.DLL)?

I’d like to call a function within a DLL using pinvoke. pinvoke itself works fine for other libs. Calling the function in the DLL from unmanaged C++ works fine, too.

The problem is that the DLL has a reference to MSVCR90.DLL which resides in some SXS folders.

Using LoadLibrary in C++ the library can be used as mentioned. Using C# I don’t know how to get the library loaded. I always get an error that MSVCR90.DLL was missing on the computer.

This is what loading the library looks like:

[DllImport("C:\\work\\dllhell\\sample\\sample.dll", 
    EntryPoint = "sample", CallingConvention = CallingConvention.Cdecl)]
public static extern int sample();

When calling the function sample, I only get the following error: HRESULT: 0x8007007E saying that the library would not have been found. Actually, the library exists in various versions in SXS directories.

I tried using Dependency Walker (depends) but it also has not been able to locate the right version of the library, so far.

There is also a manifest shipped with the library containing the following entry:

The following statement is included within the manifest:

<assemblyIdentity type='win32' name='Microsoft.VC90.CRT' version='9.0.21022.8'
    processorArchi    tecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' />

The version requested exists on my machine, I’m using VS 2010 which ships newer versions of that library but that shouldn’t be a problem, I guess.

I found a lot of threads discussing similar problems. I know, I have a dependency issue but I could nowhere find a solution. I know my missing dependency, I have a manifest but should that do it for C#, too? Not only for unmanaged C++?

  • 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-28T20:20:24+00:00Added an answer on May 28, 2026 at 8:20 pm

    In case anyone searches for that issue: of course, David Heffernan has solved the issue, the dependency has to be added to the application’s manifest, i.e. the file app.manifest, create it as new manifest in your projekt if there is no such file, yet.

    The following entry is sufficient:

      <dependency>
        <dependentAssembly>
          <assemblyIdentity type='win32' name='Microsoft.VC90.CRT' version='9.0.21022.8' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' />
        </dependentAssembly>
      </dependency>
    

    This entry goes directly to the root node assembly in the XML file.

    Thanks to David Heffernan, forget about my last comment, it has been the solution to my question.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to call the following function from my managed code: short LS_LoadConfig(LS_ID SensorID,LPVARIANT
Short problem: #include <iostream> using namespace std; int main() { double **T; long int
I'm trying to pass parameter of short type to C++ unmanaged function imported from
UPDATED SOLUTION: With my particular problem, the sort call was inside a Render function
First - a short description of a problem. I write a JavaScript function to
I am having an unmanaged dll written using C++. I am able to call
I am going to call a C++ function from FORTRAN, for which I am
So the wonderful low down on this doozie of a problem: short version: We
SHORT DESCRIPTION OF PROBLEM: I want to set the text of a searchbar without
Following problem: I want to render a news stream of short messages based on

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.