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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:15:18+00:00 2026-05-30T23:15:18+00:00

Ok this question is more about understanding what the issues are as I dont

  • 0

Ok this question is more about understanding what the issues are as I dont think anyone will be able to tell me how to fix the problem.

I am writing a .net 4 application and I have a 3rd party dll ( hasp dongle protection ) that I want to reference.

Visual studio allows me to create the reference fine and use classes contained within the dll within my code.

The first issue occurs when the program is run and the dll is actually loaded. I then get the following error.

System.BadImageFormatException: Could not load file or assembly
‘hasp_net_windows.dll’ or one of its dependencies. is not a valid
Win32 application

This weblink states how to fix this error. Coud someone expalain what the issue is and why im getting it.

After following this advice I then set the main project build to x86 and I then get another error replacing the other. The new error is:

System.IO.FileLoadException: Mixed mode assembly is built against
version ‘v1.1.4322’ of the runtime and cannot be loaded in the 4.0
runtime without additional configuration information

This weblink states how to fix the error, but I dont have an app.config in my project and want to avoid having one if at all possible. If someone could explain what the issue is again that would be helpful?

Please let me know if you require anymore information.

  • 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-30T23:15:19+00:00Added an answer on May 30, 2026 at 11:15 pm

    The issue is the “bitness” of your application. Once chosen (32 bit or 64 bit) all DLLs within that process need to be the same. This exception tells me that one of your DLLs is the wrong “bitness”.

    You simply cannot have DLLs with different compilation targets within a given process, a process has “bitness” affinity.

    If this is a third party unmanaged DLL then it is very likely 32-bit compiled.

    Setting the build output as x86 for the root project (the one that creates the exe) should suffice as this will dictate the process that is created. Any other .NET projects can then simply be Any CPU and will fit in either the 32 or 64 bit runtimes.

    Unfortunately for your second issue, the provided link is the way to solve it. There is nothing wrong with having an app.config in a project and you haven’t stated why you don’t want one.

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

Sidebar

Related Questions

EDIT: This question is more about language engineering than C++ itself. I used C++
So I'm trying to learn more about lambda expressions. I read this question on
This isn't really a programming question but more about programming and testing tools. Is
I got this in an interview question -- the question was more about what
More than about LINQ to [insert your favorite provider here], this question is about
This is kind of more generic question, isn't language-specific. More about idea and algorithm
I know there is already a question about this but my issue is more
I'm not talking about making portable code. This is more a question of distribution.
I'm not understanding some key bit of ExtJs idiom so this question is about
This particular question is more about trying to see the reason behind compiler message

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.