简体   繁体   English

错误CS0234:类型或名称空间名称“持久性”在名称空间“ UnityEngine.XR.WSA”中不存在(您是否缺少程序集引用?)

[英]error CS0234: The type or namespace name 'Persistence' does not exist in the namespace 'UnityEngine.XR.WSA' (are you missing an assembly reference?)

I'm currently developing an app for android. 我目前正在为Android开发一个应用。 In my code, I use the namespace UnityEngine.XR.WSA.Persistence . 在我的代码中,我使用名称空间UnityEngine.XR.WSA.Persistence When I'm launching the app on the editor, i have no errors, but when I try to build this to send it to my phone, I get the following one : 在编辑器上启动应用程序时,没有任何错误,但是当我尝试构建此应用程序以将其发送到手机时,得到以下消息:

The type or namespace name "Persistence" does not exist in the namespace "UnityEngine.XR.WSA". 类型或名称空间名称“ Persistence”在名称空间“ UnityEngine.XR.WSA”中不存在。 Are you missing an assembly reference?" 您是否缺少装配参考?”

Isn't it strange since it's working on the editor? 因为它在编辑器上工作,这并不奇怪吗? How do i fix it? 我如何解决它?

WSA stands for Windows Store Apps . WSA代表Windows Store Apps This is only available when building apps for Universal Windows Platform . 仅在为Universal Windows Platform构建应用程序时可用。 Especially UnityEngine.XR.WSA.Persistence afaik is or at least was previously developed by Microsoft and is even only used in particular for the HoloLens . 特别是UnityEngine.XR.WSA.Persistence afaik是或至少由Microsoft以前开发的,甚至仅专门用于HoloLens

It throws no exceptions in the Editor but afaik some #if preprocessors make sure that it also does nothing there. 它在编辑器中不引发任何异常,但是会怀疑某些#if预处理器确保它在此也什么也不做。


It is not available when building an App for Android platforms. 在为Android平台构建应用程序时,该功能不可用。

To remove the error in your script you can use #if preprocessors and Platform dependent compilation like 要消除脚本中的错误,您可以使用#if预处理程序依赖于平台的编译,例如

#if UNITY_WSA
    // anything using the UnityEngine.XR.WSA namespace
#else
    // alternative implementation for different platform
#endif

however, the functionality ofcourse will not be available on Android so if you need something similar you have to use another library or come up with one ;) 但是,courses的功能在Android上将不可用,因此,如果您需要类似的功能,则必须使用另一个库或提供一个;)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 错误 CS0234 命名空间“Microsoft”中不存在类型或命名空间名称“Reporting”(您是否缺少程序集引用?) - Error CS0234 The type or namespace name 'Reporting' does not exist in the namespace 'Microsoft' (Are you missing an assembly reference?) 仅在运行时,类型或名称空间名称“ Http”在名称空间“ System.Net”中不存在(您是否缺少程序集引用?) - The type or namespace name 'Http' does not exist in the namespace 'System.Net' (are you missing an assembly reference?) only onruntime UNITY 错误 CS0246:找不到类型或命名空间名称“MenuItem”。 您是否缺少程序集参考? - UNITY error CS0246: The type or namespace name `MenuItem' could not be found. Are you missing an assembly reference? 在using语句中无法识别命名空间。 “名称空间'#'中不存在类型或名称空间'#'。是否缺少程序集引用? - Namespace not recognised in using statement. "The type or namespace '#' does not exist in the namespace '#'. Are you missing an assembly reference? 如何修复CS0234 - 装配参考丢失 - How to fix the CS0234 - Assembly Reference Missing 命名空间“microsoft”中不存在类型或命名空间名称“mixedreality”(您是否缺少程序集引用?) - the type or namespace name 'mixedreality' does not exist in the namespace 'microsoft' (are you missing an assembly refrence?) 命名空间“Hamul.Emoji”中不存在类型或命名空间“Wpf”(您是否缺少程序集引用)? - The type or namespace 'Wpf' does not exist in the namespace 'Hamul.Emoji' (are you missing an assembly reference)? Unity 类型或命名空间名称“空间跟踪”在命名空间“UnityEngine”中不存在 - Unity type or namespace name 'Spatial Tracking' does not exist in the namespace 'UnityEngine' 在全局命名空间中找不到类型或命名空间名称“”Namespace“(您是否缺少程序集引用?) - The type or namespace name '“Namespace”' could not be found in the global namespace (are you missing an assembly reference?) 错误1找不到类型或名称空间名称'FPSTimer'(您是否缺少using指令或程序集引用?) - Error 1 The type or namespace name 'FPSTimer' could not be found (are you missing a using directive or an assembly reference?)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM