Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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
3
Question by Frederik · Feb 19, 2010 at 12:56 PM · dllmonovisualstudio

Replace Microsoft dll's with Mono dll's in Visual Studio?

I currently working on 2 Unity projects. For these two I'm writing a library to easily get login data from a server, dialog text from xml, etc. I build the dll right out of Visual Studio, so it's referencing microsofts system.dll, system.data.dll etc.

I have to be sure that the library works on Windows and Mac. Won't the microsoft dll's cause problems on Mac?

Does it make sense te remove all references to the microsoft .NET framework in my visual studio project and in stead replace them with the Mono.NET dll's? Or am I talking crazy here?

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

5 Replies

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

Answer by Lucas Meijer 1 · Feb 22, 2010 at 10:28 AM

Both can work fine. What you should make sure is that the functionality you use from the system libraries, is actually supported in the version of Mono that is shipped with Unity. Most stuff is supported, but there are some gaps in newer functionality (stuff like Linq, ParallelFX, etc).

The safest would be to just reference Mono's libraries (you can find them in the unity editor's install folder), as you would notice any types not being available.

Please note that "which version" you referenced, does not get remembered. When Unity or Visual Studio makes an assembly out of your sourcecode, that just says "Use System.dll". It does not specify a specific vendor, nor does it embed System.dll.

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 Tyson.9 · Oct 28, 2010 at 08:31 AM 0
Share

I tried referencing the $$anonymous$$ono .NET assemblies (Unity 3.0\Editor\Data\$$anonymous$$ono\lib\mono\unity) from within my VS2010 project, but VS ignores the location. That is, it accepts the dll's as valid within the 'Add Reference' dialog, but if I look at the properties on each reference they still point to the standard .NET location (C:\Windows\$$anonymous$$icrosoft.NET\Framework\v2.0.50727\System.dll). Any ideas how to actually compile against the Unity $$anonymous$$ono assemblies?

avatar image
0

Answer by cregox · Feb 19, 2010 at 06:27 PM

I don't really know or have the experience, but I bet Microsoft DLL can cause problems on the Mac. No crazy talk there - if you can use Mono.NET rather than MS.NET I highly suggest you to do so. It is made for that purpose.

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 asperatology · May 25, 2015 at 05:30 PM 0
Share

$$anonymous$$ono.NET is now linked to someone's personal site.

avatar image
0

Answer by Frederik · Feb 22, 2010 at 09:28 AM

Maybe anyone else encountered this problem too?

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

Answer by Shawn · Feb 23, 2010 at 12:45 AM

I have done some compiling of DLLs for use with Unity iPhone and the biggest problem I have found is making sure you are compiling against the correct version of mono and not attempting to use features which are not in the Unity version of mono.

I have compiled numerous DLLs using .NET 2.0 in VS and they work just fine on the Mac and iPhone; but there are certain features that .NET 2.0 supports which if you use will cause errors on the Unity side.

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

Answer by Ashkan_gc · Feb 23, 2010 at 05:51 AM

as lucas said you don't need to reference mono DLLs to make your library compatible with unity but it will help in visual studio because you can see what is available in mono or not. if you use vs 2008, choose .NET 2.0 as the target platform because newer features and even some of 2.0's features are not available in unity's mono version. there is an analyzer tool called MOMA that you can use to check if there is any errors available. it will tell you about methods that you used that they are not available in mono.

more info when you compile an assembly, the compiler will create CIL code from your code and store them in a PE (EXE) file. it also stores metadata and references names and ... there is no difference between compiling with mono or Microsoft's compilers or using Microsoft or mono libraries. the runtime that you use (mono/MS .NET) should have those libraries and methods that use use or should be able to execute those CIL instructions. most of the times the problem is about platform dipendent libraries that mono should implement for each platform. so you just need to make sure mono has the libraries that you use and also see if it supports those methods that you use or not.

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

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

No one has followed this question yet.

Related Questions

using Mono.Data.Sqlite missing an assembly reference? 4 Answers

how to load Dll into Unity 2 Answers

The type or namespace name... again 0 Answers

Components Inside A DLL 3 Answers

Is there an assets subfolder that the Unity compiler will ignore? (Asset Server Related)) 6 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