Why does downgrading my framework version and then upgrading again allow this .dll to load properly?


I am trying to automate some data collection using an Oscilloscope. I have a USB scope with plenty of examples. The examples worked just fine, but when I tried to create my own project things stopped working. I have mirrored their setup with respect to the .dll location and which is referenced in the project. Whenever the program tried to access any part of their .dll I continue to get

An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)".

There is however, nothing wrong with the .dlls. They are copied and pasted straight from the examples.

After changing a single variable many times over I found out how to fix the issue, at least in the short term. I found that I was targeting a different framework than they were. They target 2.0 and I was targeting the current 4.6.1. The page linked above says it should work with .NET 2.0 and newer. So I downgraded my project to 2.0 and now I do not get an exception when interacting with the .dll. Then if I upgraded to 4.6.1 it would continue to work.

My question is why, if possible to explain without their source code, does downgrading and upgrading again fix the issue?

Also, does this "fix" pose any long term issues that I need to be aware of?

asked on Stack Overflow Apr 10, 2019 by OsakaRhymes • edited Apr 10, 2019 by Lews Therin

0 Answers

Nobody has answered this question yet.

User contributions licensed under CC BY-SA 3.0