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 _raj9 · Mar 29, 2017 at 02:49 PM · unity 5.netwindows 10windows store app.net-assemblies

Using .NET 4.6 features not supported by Unity WSA Build

Hi,

We are facing an issue trying to use .NET 4.6.1 System.Numerics.Vectors in a HoloLens app. An UWP API we are calling is returning a System.Numerics.Vectors Vector2 and Vector3.

To be clear, the code is only enabled for the UWP/WSA platform, so disabled in the Editor Mono runtime itself, using #if NETFX_CORE Still it fails during Build for WSA UWP 10 HoloLens in Unity: "Reference rewriter: Error: method System.Numerics.Vector2 Windows.Media.Devices.Core.CameraIntrinsics::get_FocalLength() doesn't exist in target framework "

I assume this is because the WinRT / UWP / WSA target in Unity does not use .Net 4.6.1 yet. We tried with Unity 5.5 and 5.6. The workaround for now was to comment out the code in the script for Unity build and then to uncomment in VS when it's actually build for the HL.

But that is not a great workflow at all, so what is the best way to enable that?

We also tried to use the System.Numerics.Vectors NuGet package PCL DLL in Assets\Plugins which works in Unity but then fails during actual build in VS due to duplicate references. No surprise.

Another idea would be to make an extra .Net DLL only with that code pieces using System.Numerics.Vectors and then to include that DLL in Assets\Plugins\WSA so Unity does not process the DLL further during its build. But that's not a great approach.

TIA

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 MarekKowalski · Jan 26, 2018 at 08:17 AM

I am facing the same issue right now, a year later. Have you managed to solve it somehow?

Thanks,

Marek

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 _raj9 · Jan 29, 2018 at 05:45 AM

Unity 2017 should work with .NET 4.6 fine.

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 MarekKowalski · Jan 29, 2018 at 09:16 AM 0
Share

I tried turning on .NET 4.6 support but it still gives me the same error, no clue where to go on with this. The weirdest part is, that while I get the error when the VS project builds, and Unity says the build failed, the project in fact works just fine. This behaviour is independent of whether I use .NET 4.6 or not.

avatar image _raj9 MarekKowalski · Jan 29, 2018 at 09:21 AM 0
Share

You can always create a custom dll for WSA and tell unity editor not to process the dll during it's build. basically that's what I ended up doing. It made sense as I had a larger native plugin which this could be a part of.

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Create a .net library for hololens / uwp 2 Answers

Universal Windows Platform - Huuuuuuuge Build Error 0 Answers

Installed Windows 10, can't start Unity 4 Answers

Unity 2017.3 Experimental 4.6 .NET not including System.Web.Http assembly for HttpClient use 0 Answers

This not reading folders in the Windows Store 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