Sign up ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm pretty new in Unity and i'm trying to write reusable code to use across multiple "project". So I wrote this class to POST and GET highscore via WebRequest. I compiled the project to a DLL and added the DLL in my assets folder, and then I created a test script added to a GameObject opened it in VS2013 and created a reference to the DLL in the Assets folder, and now im trying to use it and it keep saying that the class name doesnt exist.

enter image description here

share|improve this question

1 Answer 1

A few items you will need to address for a dll to work in monodevelop:

  1. Your class, constructor, and method in the dll must be public
  2. You must use a .net compiler that is compatible with monodevelop (yours is) and the language must also be compatible. F# for example isn't.
  3. Make sure to reference the assembly/dll in your references (i see you did in the screen shot)
  4. Add 'using myclass' as the name from your dll into the header of the monodevelop cs script
  5. Make sure any resources you are using in your dll are available and usable for monodevelop. If you are using another external dll (anything outside of the clr), it becomes a dependency for your dll and must be included as well.

Here is a handy reference from unity on the subject for more reading including how to debug a session between the environments. Otherwise reply with questions if this isn't enough detail to help with your issue.

http://docs.unity3d.com/Manual/UsingDLL.html

share|improve this answer
    
I added the reference to my project, I tried something weird. Could it be bacause I compiled the DLL in .NET 4.5 ? I tried compiling the DLL in .NET 3.0 and I was able to use it in my unity project. – PL Audet Feb 25 at 1:54
    
It's remarkably difficult to find a compatibility matrix. One I found shows .net 2.0 but most posts indicate its 3.5 with a few 4.0 features thrown in. Its not a Microsoft build but its between those two versions since Unity4.3. I don't have a test handy to try it unfortunately. If you don't mind, leave feedback if you try and it works, I'll update the post for others trying to compile. – Tim Cederquist Feb 26 at 8:01
    
Well I have tried compiling it in .Net 3.0 and it Worked. I have not tried other version. I will probably do it this weekend. Thanks a lot – PL Audet Feb 26 at 15:44

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.