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 Unitraxx · Oct 21, 2014 at 06:32 PM · monodevelopdllmono

How to use Unity's mono to compile in MonoDevelop

I want to create a .dll to use in Unity, by using MonoDevelop. Since my code makes use of the default arguments feature I am forced to use .NET 4.0 for compiling. If I compile that way however, then Unity throws an error when accessing classes in the .dll. (Error : "Could not load type .. from assembly..").

Now I did some research and I think the reason is that Unity simply doesn't support .NET 4.0 assemblies. However if there is a different solution to my problem, please let me know!

OK since I believe 4.0 is the problem, and 3.5 throws errors at the default arguments, I wanted to know if it's possible to use the compiler that Unity uses. So basically what I want to achieve is, when I click build in Monodevelop, that not microsoft's compiler is run to create my .dll, but Unity's fork of Mono. I believe this might solve my problem, but again I'm not sure.

Comment
Add comment
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

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Tanshaydar · Oct 23, 2014 at 12:08 PM

I'm not really sure as how you proceed to create these DLLs, as I didn't have any real trouble creating mine DLLs.

These two links might be helpful:

http://forum.unity3d.com/threads/publishing-content-to-the-asset-store-using-dll-files.104517/#post-689272 http://docs.unity3d.com/Manual/UsingDLL.html

I followed them myself, and it worked. But then again, I am not really sure what's causing your problem.

Edit: Oh I see, it is a version problem. I didn't try to compile with higher .Net versions.

Comment
Add comment · Show 3 · 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 Unitraxx · Oct 23, 2014 at 12:13 PM 0
Share

I've landed on those links multiple times and unfortunately are not of any help. $$anonymous$$ain problem: if I build my dll with as target platform $$anonymous$$ono/.NET 4.0 then I can't use the dll in Unity. If I target .NET 3.5 then it does work but default parameters for instance is a feature available in mono and .NET 4.0 but not in .NET 3.5.

avatar image Tanshaydar · Oct 23, 2014 at 12:14 PM 0
Share

Sorry, I misread the question about the version thing. I never tried with higher versions. Answer below is correct.

avatar image Unitraxx · Oct 23, 2014 at 12:18 PM 0
Share

Yeah I found it rather hard to explain my problem, but thanks anyway for taking your time to look up those links.

avatar image
0

Answer by screenname_taken · Oct 23, 2014 at 12:12 PM

Unity so far supports just .NET 2.0. The development team said that they are working on a solution to the issue to support a higher version, but that is to come with Unity 5.x

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 Unitraxx · Oct 23, 2014 at 12:17 PM 0
Share

I understand that, but the compiler that Unity uses to compile C# scripts makes use of a modified $$anonymous$$ono that does allow for instance the default parameters feature. So if I would be able to compile my dlls using the Unity compiler isn$$anonymous$$d of the $$anonymous$$icrosoft compiler I think it should work. (Or I want at least give that a try) But I can't figure out how to properly use that compiler to create a dll

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

28 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 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

Running pdb2mdb.exe as a MonoDevelop 2 Answers

SHA1 is an unsupported hash algorithm for RSA signing 0 Answers

Unity Project doesn't have solution file 1 Answer

The requested feature is not implemented 0 Answers

Build game with dll does not work properly 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