• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
Question by TowerOfBricks · May 25, 2012 at 02:40 PM · editordllassemblyassetstorecompiling

C# dll "MissingMethodException" - Before first recompile

Hi

I'm using a 3rd party C# dll in my project. It works great most of the time, I can use it without anything throwing errors. But if I have just opened Unity, and click play. It will throw a MissingMethodException when it tries to access some function from the dll. Then, if I just change the name of a folder, make a small edit to a script, or something else which causes scripts to be recompiled, it works perfectly again until I restart Unity. If I try to build before unity has recompiled anything, I get compiler errors saying much the same thing as the MissingMethodException (but if it has recompiled, it works great).

I can solve this by putting the .dll file in the Assets/Plugins folder. However I cannot do that since I am including this in a package which is to be released on the Unity Asset Store.

So my questions are, why does it fail before any recompilation has been done. Shouldn't Unity detect the dll? And is it possible to have a Plugins directory in a package released on the Asset Store (which works), or another way of making sure the dll is compiled before the rest of the code?

I cannot but my whole package inside the Plugins or Standard Assets folder because I also need an Editor folder.

If this cannot be done, I am asking all Unity developers out there to improve on their compilation order system so we can manually specify compilation order for certain folders.

I do have the source code for the dll, but it really seems very ugly to paste that into the project, especially since I will have to edit a lot of defines to make it work properly.

Thanks in advance!

Comment

People who like this

0 Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image TowerOfBricks · May 25, 2012 at 02:45 PM 0
Share

Another option would be to be able to include multiple separate folders in the unitypackage uploaded to the assetstore (for example Assets/MyPackage, and Assets/Plugins/MyPackagePlugins). But if I understand correctly, that is not possible?

avatar image TowerOfBricks · May 25, 2012 at 03:14 PM 0
Share

Of course, another option would be to add an installer editor script which all editors prompt you to run after importing the package to move folders to more compatible places (dlls to Assets/Plugins for example). But that seems really ugly.

1 Reply

· Add your reply
  • Sort: 
avatar image
Best Answer

Answer by TowerOfBricks · May 25, 2012 at 03:58 PM

Okay... This is really weird, but the issue seems to have gone (never know) when I changed the dll name from JsonFx.Json.dll to JsonFx.dll... And it is weird because I have another dll which I use (though later in the code than the first one, so it wasn't called before) and the name of that dll is Ionic.Zip.Reduced.dll and that works, when I thought it was the . (dot) in the name that did it... Anyway, it seems to work now, but I still think that Unity dev should implement a way we can define compilation order manually.

Comment

People who like this

0 Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image TowerOfBricks · May 25, 2012 at 04:03 PM 0
Share

Ok, tried to change the name back -> error comes back again. But I did some more experimenting, and it seems like if I name the dll to a namespace in the dll (like JsonFx.Json, that is a namespace in the dll) the error is thrown, but if I name it to something else with dots in the name (like JsonFx.Random), the error is not thrown.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Why does Assembly-CSharp reference UnityEditor.dll 0 Answers

Can Editor scripts be in external DLL's or assemblies? 1 Answer

Custom editor DLLs 1 Answer

Why can't I build Web Player in Unity while I have no problems with building standalone versions? 2 Answers

Set Reflected assembly name after dynamically Loading Dll 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges