views:

12

answers:

0

Hello,

I created a library of classes in C++ and compiled it to a .dll. Everything compiles fine in .NET framework 3.5 using VS2008.

Then I want to reference my .dll in a C# project I'm working on in VS2010. The .dll is linked fine and all the methods are loaded properly (meaning if I type a class variable and then a ".", it drops down a list of all the optional methods). Then, just to let me get my hopes up, VS2010 builds my program just fine in .NET Framework 4.0. However, when I attempt to actually run my program, it runs into a method imported from the .dll saying that a procedure could not be loaded and to check if it is a valid .NET assembly. I don't understand what this means. If that method were unusable, why would it let me compile it?

I've searched around a lot but can't seem to find an answer that makes sense to me (considering I don't understand dlls very well). Is there something special I have to do when compiling my .dll? Is .NET for some reason not always backwards compatible?