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
0
Question by JasonsFreeTime · Mar 25, 2020 at 03:40 PM · pluginsapiil2cpp.net.net-assemblies

Managed Plugin with System.Device assembly gives error

Hello, I wrote a plugin that references the System.Device.dll assembly. When I put the plugin into the Assets/x64 folder I get this error:

 Assembly 'Assets/Plugins/x64/GpsPlugin_Net4.dll' will not be loaded due to errors:
 Unable to resolve reference 'System.Device'. Is the assembly missing or incompatible with the current platform?
 Reference validation can be disabled in the Plugin Inspector.

I have also added a csc.rsp file to the Assets/Editor directory and it includes the line:

 -r:System.Device.dll

I've tried using both Mono and IL2CPP scripting backend. The Api Compatability Level is .NET 4.x. The System.Device namespace was introduced in .Net 4.0 so doesn't IL2CPP support .Net up to 4.6?

Is there some restriction for certain libraries such as System.Device.dll ? Trying to access the Windows GPS sensor data from Unity? Since this isn't a mobile device I can't use Input.Location.

Can you help @JoshPeterson ?

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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by JoshPeterson · Mar 25, 2020 at 03:58 PM

Unity does not support System.Device.dll - in fact the base class libraries Unity ships with do not include it. You may be able to manually add it to your project as a managed plugin from Nuget though. See https://www.nuget.org/packages/System.Device.Location.Portable/

Comment
Add comment · Show 2 · 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 JasonsFreeTime · Mar 25, 2020 at 06:35 PM 0
Share

Thanks for the suggestion - unfortunately that Nuget package is only for manipulating GeoCoordinates and not for actually getting the lat/lon from the OS.

BTW - I have assumed that Unity's Input.Location API isn't going to work based on the fact that the documentation says its for portable devices only. Does that mean it will only work for Andoid and IOS devices? I consider my Windows Laptop a portable device so will that Input.Location API work? I have Location Services turned on in my Windows settings.

If it won't work, what exactly will be the reason, like how does it decided if I'm using a portable device or not?

I guess I'll have to try it.

avatar image JoshPeterson JasonsFreeTime · Mar 25, 2020 at 06:46 PM 0
Share

I'm unsure about the Unity API's platform support in this case, sorry. It might be worth a try to see what happens though.

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

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

"Error Invalid option '6' for /langversion; must be ISO-1, ISO-2, 3, 4, 5 or Default" using .Net 4.6 1 Answer

No Option to Select .NET 4.x API Compatibility 1 Answer

Building Project that contains .NET dependencies with Travis CI 0 Answers

System.IO.Ports with .Net Standard 2.0? 1 Answer

Anyway to workaround .NET 4.0 framework outside/inside Unity? 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