Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • 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
0
Question by DocteurCox · Aug 07, 2013 at 08:34 PM · c#buildmonodevelopdllmissingmethodexception

Equality and Inequality operators not found in DLL ???

Hey there !

So here's the problem... After some refactoring to remove default operators so that it compiles well, now I get some new funny errors when trying to use it. I get MissingMethodExceptions all over the places for pretty much all reflection types.

At first, I had trouble with == operator for Type class. I still don't understand why that didn't work since Equals method was implemented, but whatever. Now I have trouble with MemberInfo == operator, and that's like really really boring. Isn't it the C# standard behaviour for == operator to call object's ReferenceEquals method if it was not explictly implemented by derived class ? (which is pretty much all I need since I use that for null check)

There's definitely something I don't understand there. Thousands things work in Unity (like default arguments, aforementioned operators...) and just don't work when you build it in a DLL. Just what's the logic behing that ? Is there something I'm doing wrong ?

Thanks in advance for your answers.

Comment
Add comment · Show 6
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 Xtro · Aug 07, 2013 at 08:38 PM 0
Share

Where are you building the dll in? $$anonymous$$onoDevelop?

avatar image DocteurCox · Aug 07, 2013 at 08:41 PM 0
Share

In a separate solution in $$anonymous$$onoDevelop yeah. It builds well, it's just not working when I call my code from script. (I get those weird $$anonymous$$issing$$anonymous$$ethodException I was talking about)

avatar image Xtro · Aug 07, 2013 at 08:57 PM 0
Share

I know I'm saying the same thing too much in this answers page but, it may be about API compatibility level. Please try to set the API level in the player settings to full .net (not the subset)

If this fixes your problem, still you don't have to use the full .net level. You can use the subset level but I think you should build your dll compatible with subset level. I don't know if there is a setting in $$anonymous$$onoDevelop to be able to build it that way.

avatar image DocteurCox · Aug 07, 2013 at 09:07 PM 0
Share

Erf, no luck. That doesn't seem to change anything. I still get exceptions. Thanks for your answer though :)

Definitely, that's weird. Unity does build Editor and Runtime assemblies with default arguments, equality operators etc. so there must be a way to do build all that in a custom DLL. I really wonder what I'm doing wrong.

avatar image Xtro · Aug 08, 2013 at 02:24 AM 0
Share

if you can prepare a small assembly project that has the same issue, I can try to build it and add it to unity.

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by DocteurCox · Aug 08, 2013 at 12:00 PM

Ok, after further investigation, I was finally able to understand why I had those problems.

I checked projects settings in MonoDevelop, and it appeared that target framework was Mono/.NET 4.0 by default. I didn't want that, but that's just how it was. == operator for Type, MemberInfo etc. were implemented in .NET 4 and later. So it appears that when compiling my code for Mono/.NET 4, it was looking for == operator of those types instead of just using object's, which resulted in runtime errors because it was trying to use an operator that wasn't implemented yet in Mono/.NET 3.5 which Unity uses.

Now I compile for Mono/.NET 3.5 and it works just fine !!! :)

Comment
Add comment · 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 Xtro · Aug 08, 2013 at 01:28 PM 0
Share

Yea totally! When I suggested you to check the Unity's API level, I assumed you were building it for the correct .net version already. Anyway, good to hear it's working now.

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.

Follow this Question

Answers Answers and Comments

16 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Distribute terrain in zones 3 Answers

Does a DLL work in an iOS build? 1 Answer

Why is the 'Run' button in Monodevelop is grayed out? 1 Answer

Build error when using BooleanOps.dll 1 Answer

Build itextsharp dll Lite 1 Answer


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