0 votes
by (8.2k points)
edited by

Hello,
I am trying to implement
using UnityEngine.XR.Management;
in a script I am writing, but visual studio 2022 is telling me that
The type or namespace name 'Management' does not exist in the namespace 'UnityEngine.XR' (are you missing an assembly reference?)

The package has worked fine elsewhere in the project in other scripts, I don't know why it would give me this problem here.

My project is using the packages
XR Interaction Toolkit 2.0.2
XR Plugin Management 4.0.7
Oculus XR Plugin 1.10.0
OpenXR Plugin 1.2.8
Visual Studio editor 2.0.16

1 Answer

0 votes
by (8.2k points)

Do you have an asmdef file in your project? You may need to create one. You can then reference the Unity XR Management assembly by clicking the add button (

+

) in the Assembly Definition References for your Assembly Definition file (see image).
upload_2022-7-25_16-26-14.png
The Assembly name is actually Unity.XR.Management, although the namespace in code will be 

using UnityEngine.XR.Management;
TechXR runs courses in AR / VR / Metaverse / Game Development. Some of the popular Q&A in our courses are available here for easy discovery.

113 questions

117 answers

8 comments

99.7k users

...