Reputation: 17
I wrote a library to help with 2D animation and am unable to add the DLL as a reference. I've never created a DLL before so I may be doing something wrong, but I've searched the Internet and was unable to find a solution.
What I did: 1. In my library project I went to Build>Build Solution 2. I then copied the DLL in my Bin>Debug folder to my desktop 3. In my actual XNA project I right clicked on References>Add Reference>Browse, selected my DLL and made sure it had the box ticked and then OK.
The DLL looks fine in the references list, no caution triangle or anything.
In my main class when I try to put
using AnimationHelper;
It is saying the type or namespace cannot be found, and asks if I am missing a directive or assembly reference.
When I right click on the reference and view in the object browser, it is almost as if my DLL is empty. I'd click on the drop down arrow there would be nothing that drops down.
I have tried to change the target framework as suggested on Google but the box is blank and greyed out.
I've tried to find an answer everywhere for this and couldn't find one and so this is my last resort. I have tried everything I know (which isn't much) to solve this and have been unable to.
Thanks to anyone who tries to help.
Also, both the project and dll were made with XNA, if that is any help.
Upvotes: 0
Views: 189
Reputation: 864
Is the .dll built as x64 (Any CPU) or x86? XNA games are always x86, so can't load x64 libraries.
I recommend making sure you build your library as x86 then try adding it again (remove the existing reference from your XNA project before you try to add it again).
http://blogs.msdn.com/b/shawnhar/archive/2008/02/25/xna-framework-on-64-bit-windows.aspx
Upvotes: 0