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 6725225
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:46:56+00:00 2026-05-26T09:46:56+00:00

I have a .NET 4.0 32 bit (x86) desktop application with the following files,

  • 0

I have a .NET 4.0 32 bit (x86) desktop application with the following files, one of which is a legacy unmanaged library called from a wrapper lib written in managed c++.

  1. Application.exe (C#, .net 4)
  2. Library.dll (C#, .net 4)
  3. UnmanagedWrapper.dll (managed c++)
  4. Unmanaged.dll (c)

The files 1 and 2 are built by a VS 2010 solution. The corflags for these look as follows:

Version   : v4.0.30319
CLR Header: 2.5
PE        : PE32
CorFlags  : 3
ILONLY    : 1
32BIT     : 1
Signed    : 0

The unmanaged wrapper library was originally built with VS 2008, like this:

Version   : v2.0.50727
CLR Header: 2.5
PE        : PE32
CorFlags  : 16
ILONLY    : 0
32BIT     : 0
Signed    : 0

In this configuration, it worked without problems. Then I migrated the unmanaged wrapper project to be built in VS 2010 which gives .NET 4 as target by default:

Version   : v4.0.30319
CLR Header: 2.5
PE        : PE32
CorFlags  : 16
ILONLY    : 0
32BIT     : 0
Signed    : 0

In a section of code inside Library.dll I use Assembly.GetExecutingAssembly().GetTypes() to find types implementing a certain interface inside the Library. Since the library references the unmanaged wrapper, it will be loaded at this point.
Running this on a number of machines (All Win 7 Pro x64 machines) I get varying results:
On a few machines it throws a ReflectionTypeLoadException complaining that UnmanagedWrapper.dll or one of its dependencies can’t be loaded.

It works perfectly on other machines. What could be the difference between the machines where it works regardless of whether the wrapper lib is 2.0 or 4.0, and those machines where it only works if the wrapper is 2.0? The only clue I have so far is that
machines with VS 2010 seem to work, whereas machines with only a .NET (4.0.30319) install will see the exception. What should that be telling me?

  • 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-26T09:46:56+00:00Added an answer on May 26, 2026 at 9:46 am

    In such cases where the applications doesn’t work where Visual Studio is installed, occasionally the solution is that you need to install Visual Studio Runtime. Try installing either Microsoft Visual C++ 2008 Redistributable Package (x86) or Microsoft Visual C++ 2010 Redistributable Package (x86) and if it works make sure its part of your deployment strategy.

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

Sidebar

Related Questions

I currently have a 32-bit .Net application (on x86 Windows) which require lots of
I have an existing 32-bit ASP.NET application that used 32-bit unmanaged DLLs. If I
I have a 32-bit .net application that uses a native 32-bit DLL via DllImport().
I have a .Net application running on a 32 bit box. The application is
I have a .NET app which works in 32 and 64 bit. I would
Bit of a backstory to this one... I have an ASP.NET Login App on
I have the following code setup: http://jsfiddle.net/bABHU/2/ Had to change it a little bit
I have a .NET application that runs on both x86 and x64. I'd like
I was compiling a .NET application targeting x86-64; however, the application references a 32-bit
I have a C# library that is called by various clients (both 32-bit and

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.