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 WillNode · Mar 24, 2015 at 08:25 AM · crashpluginmono.net

Use .NET native dll calls

Hi, recently i doing a little crazy stuff with unity. so what I do is copy a .NET assemblies (System.Management) to unity Plugins folder. then, I trying to test it within my project using this code:

 ManagementObjectSearcher searcher = new ManagementObjectSearcher (
 WMINamespace,
 "SELECT " + Member + " FROM " + WMIClass + " " + AddQuery);

but suddenly, when i try that script, unity crashed even when i debug my script from MonoDevelop. even when i build the project, unity fail to compile the .NET assembly inside Plugins folder.

so is there anybody have tried this crazy stuff? cause as far as i know that Unity are using mono Assemblies, and from mono documentation says, System.Management are not included in their assemblies.

Comment
Add comment · Show 4
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 WillNode · Mar 24, 2015 at 10:08 PM 0
Share

bump......

avatar image Ben-BearFish · Mar 24, 2015 at 11:50 PM 0
Share

There might be a conflict between Unity's $$anonymous$$ono libraries and .Net's dll. It might help others to answer if you post the exact error you are getting and what version of Unity you are using.

avatar image WillNode · Mar 24, 2015 at 11:55 PM 0
Share

ok, the error says it's an access violation (when i run inside editor), but I can't debug this error. also I try both 4.6 and 5.0 still have same error.

avatar image spiceboy9994 · Mar 27, 2015 at 12:11 AM 0
Share

Have this worked before on any versions of unity?. What I've done before (with unity Pro) was to create custom dlls and use them within unity project. But according to this .net Assembly / Class definition, it tries to get System information (like network , drives, and so on). Since unity has a subset of the .net libraries, and strictly speaking it looks like a client side technology, not sure if this specific class may be available within it. Have you tried with another dll?

1 Reply

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

Answer by SirAstral · Mar 27, 2015 at 12:36 AM

If you are trying to do what I am doing, you cannot just import .Net DLL class libraries. You need to first set Unity API Compatibility Level to .NET 2.0 instead of .NET 2.0 subset.

Unless you are doing something weird by all account Unity does not support anything higher than .Net 3.5 dll's being imported. So if you are like me and trying to build a WebPlayer bases application that needs to use this, then you are just flat out of luck unless you build an entire class from pure scratch to support it. This tool would make a beastly application platform if Unity would just get their act together with .Net support. It is shocking that a lot of organizations just do not keep up to date support for .Net in their products properly... Microsoft including and its their own product. Shocker there right?

http://answers.unity3d.com/questions/932874/adding-service-references.html

Comment
Add comment · Show 4 · 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 WillNode · Mar 27, 2015 at 12:06 PM 0
Share

thanks!, now i can run and build my project. to make unity are not crashed, I need to reference my script as DLLs

but there is new problem, Unity gives me new Error :

 NotImplementedException: The requested feature is not implemented.
 System.$$anonymous$$anagement.$$anonymous$$anagementObjectSearcher..ctor (System.String scope, System.String queryString)
 (wrapper remoting-invoke-with-check) System.$$anonymous$$anagement.$$anonymous$$anagementObjectSearcher:.ctor (string,string)
 W$$anonymous$$IPort.WmiGetValue (System.String W$$anonymous$$INamespace, System.String W$$anonymous$$IClass, System.String $$anonymous$$ember, Int32 Index, System.String AddQuery)
 W$$anonymous$$IPort+<loop>d__0.$$anonymous$$oveNext ()
 UnityEngine.$$anonymous$$onoBehaviour:StartCoroutine(IEnumerator)
 W$$anonymous$$IPort:Start()

and i see that i'm use .NET version 4.0, how I can insert .NET Dlls version 2.0? it should be exist somewhere.

avatar image WillNode · Mar 27, 2015 at 12:54 PM 0
Share

okay, I found it on %windir%\$$anonymous$$icrosoft.NET, but it still gives me same error.

look like I'm out of luck.

avatar image SirAstral · Mar 27, 2015 at 01:21 PM 0
Share

There are a lot of areas you can find DLL's to import. Windows, Program Files they have several directories holding .net libraries.

If you are looking for the proper version of System.$$anonymous$$anagement.dll try here

Program Files (x86)\Reference Assemblies\$$anonymous$$icrosoft\Framework.NETFramework\v3.5\Profile

Hope this helps!

avatar image WillNode · Mar 27, 2015 at 09:44 PM 0
Share

hmmm, i the Profile folder isn't exist for me,

but any way, your answer is enough to solve my problem, i just make little experiment with unity, and look like it's won't be supported in unity since it's a cross platform.

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

24 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

Related Questions

Game Thrive (One Signal) causes game to crash when calling init method. 1 Answer

Trying to use SDK as plugin that compiled with .NET Framework 4.0 in Unity 1 Answer

Most consistent way to handle Timezones (plus JNI help) 2 Answers

GoogleVR on Unity has error can't load libaudioplugingvrunity 0 Answers

Editor crashes on second play 2 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