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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T03:55:54+00:00 2026-06-12T03:55:54+00:00

In one of the projects I am working the code dynamically loads in a

  • 0

In one of the projects I am working the code dynamically loads in a .net DLL into a fully trusted Assembly using the Assembly.LoadFrom function. Up to now this has been working 100% without issue.

I now have a Visual C++ DLL compiled with /clr:pure that needs to get loaded using the above Assembly.LoadFrom. I get BadImageFormatException when I do which is really weird.

In the Visual C++ Project there are 3 types of CLR compile options:

/clr

/clr:pure

/clr:safe

As per the instructions given to me it needs to be compiled under /clr:pure. My problem is using /clr:pure throws the exception. If I change it to /clr it also throws an exception. If I change it to /clr:safe it loads in without throwing an exception (thisis where my testing ended).

So I guess this is really a two part question:

1) Why would /clr:safe work but not the other two?

2) How do I get it to work with /clr?

Thanks in advance!

  • 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-06-12T03:55:56+00:00Added an answer on June 12, 2026 at 3:55 am

    After research this method can not load mixed assemblys. They can only be pure MSIL.

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

Sidebar

Related Questions

I recently ran across this code in one of the projects I'm working on,
I ended up with this code in one of my projects: function foo(type, desc)
I am using VS 2008 Express. One of the projects I'm working on uses
In one of the projects I'm working on, I'm seeing this code struct Base
In one of my projects I am working on I am using Entity Framework
I'm working on one of those projects where there are a million better ways
All: I am working on a solution where one of the projects is actually
I am working on one of the opensource projects. I am facing a weird
I'd like to eventually publish one of the iPhone projects I've been working on
While working a project tonight, I ended up using one .js resource file for

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.