简体   繁体   English

命名空间“microsoft”中不存在类型或命名空间名称“mixedreality”(您是否缺少程序集引用?)

[英]the type or namespace name 'mixedreality' does not exist in the namespace 'microsoft' (are you missing an assembly refrence?)

I am currently developing an app for the Hololens 2 with Unity and mrtk.我目前正在使用 Unity 和 mrtk 为 Hololens 2 开发应用程序。 I am trying to get the Gaze direction from the GazeProvider.cs which is attached to the camera, because i want to spawn objects in front of the players face.我正在尝试从连接到相机的 GazeProvider.cs 获取 Gaze 方向,因为我想在玩家面前生成物体。 I am trying to access it like the mrtk site states:我正在尝试像 mrtk 网站所述访问它:

void LogGazeDirectionOrigin()
{
    Debug.Log("Gaze is looking in direction: "
        + CoreServices.InputSystem.GazeProvider.GazeDirection);

    Debug.Log("Gaze origin is: "
        + CoreServices.InputSystem.GazeProvider.GazeOrigin);
} 

However when trying to using Microsoft.MixedReality.Toolkit;但是,当尝试using Microsoft.MixedReality.Toolkit; the error错误

the type or namespace name 'mixedreality' does not exist in the namespace 'microsoft' (are you missing an assembly refrence?)命名空间“microsoft”中不存在类型或命名空间名称“mixedreality”(您是否缺少程序集引用?)

occurs.发生。 Therefore CoreServices is also not recgonized.因此 CoreServices 也没有被认可。 Also i recognised, that the GazeProvider.cs hat this path in the package folder Packages/com.microsoft.mixedreality.toolkit.foundation/Services/InputSystem/GazeProvider.cs .我还认识到,GazeProvider.cs 在包文件夹Packages/com.microsoft.mixedreality.toolkit.foundation/Services/InputSystem/GazeProvider.cs中有这个路径。 I don't know how to fix this or how to access the gaze direction of the player, i have been searching for a while now.我不知道如何解决这个问题或如何访问玩家的注视方向,我一直在寻找一段时间。

I would appreciate some help, thanks!我会很感激一些帮助,谢谢!

In order to get acces to the toolkit you probably have to install the package from the nuget package manager.为了访问该工具包,您可能必须从 nuget 包管理器安装该包。 Check out this Link to see how you can include it.查看此链接以了解如何包含它。

Thanks for the answers, but it unfortunately did nothing for me.感谢您的回答,但不幸的是它对我没有任何帮助。 I had to create a complete new project and migrated some prefabs i used there.我必须创建一个完整的新项目并迁移我在那里使用的一些预制件。 Something with the Assemblies was broken and not created right.组件的某些东西被破坏并且没有正确创建。 Some of the mrtk packages probably generated new assamblies, but i do not know which one.一些 mrtk 包可能会生成新的组件,但我不知道是哪一个。

File→Build Settings→Play Settings→As shown below in OtherSettings File→Build Settings→Play Settings→OtherSettings中如下图

在此处输入图像描述

Change it to the one that is different from the original, ctrl+s save can try it, thank you换成和原来不一样的,ctrl+s save可以试试,谢谢

Hi I'm Wayne Wang from the Microsoft for Founders Hub team!大家好,我是 Microsoft for Founders Hub 团队的 Wayne Wang!

Here is my suggestion:这是我的建议:

  • make sure you are using latest "Mixed Reality Feature Tool" to install packages dependencies as "Local tarball"确保您使用最新的“混合现实功能工具”将软件包依赖项安装为“本地 tarball”
  • Go to the unity menu: "Edit" ->"Preferences" ->"External Tools".进入统一菜单:“编辑”->“首选项”->“外部工具”。 It was the place you can change your visual studio versions.这是您可以更改视觉工作室版本的地方。
  • You may see a list with checkbox looks like this List of checkboxes您可能会看到一个带有复选框的列表,类似于此复选框列表
  • Make sure the generation of "Local tarball" was selected确保选择了“本地压缩包”的生成

after the setting was saved, the pacakge you referenced may create new projects in your project of C#.保存设置后,您引用的 pacakge 可能会在您的 C# 项目中创建新项目。 These projects actually can be references of your current major project.这些项目实际上可以作为您当前主要项目的参考。 The errors should be gone by then.到那时,错误应该消失了。

暂无
暂无

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

相关问题 命名空间中不存在类型或命名空间名称(您是否缺少程序集引用?) - The type or namespace name does not exist in the namespace (are you missing an assembly reference?) 类型或名称空间名称在名称空间中不存在“是否缺少程序集引用?” - The type or namespace name does not exist in the namespace ''are you missing an assembly reference ?" 类型或名称空间名称“ OpenIdConnect”在名称空间“ Microsoft.Owin.Security”中不存在(您是否缺少程序集引用?) - The type or namespace name 'OpenIdConnect' does not exist in the namespace 'Microsoft.Owin.Security' (are you missing an assembly reference?) 类型或名称空间名称“ Practices”在名称空间“ Microsoft”中不存在(您是否缺少程序集引用?) - The type or namespace name 'Practices' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) 错误18类型或名称空间名称'TeamFoundation'在名称空间'Microsoft'中不存在(您是否缺少程序集引用?) - Error 18 The type or namespace name 'TeamFoundation' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) C#类型或名称空间名称“ Interop”在名称空间“ Microsoft.Office”中不存在(您是否缺少程序集引用?) - C# The type or namespace name 'Interop' does not exist in the namespace 'Microsoft.Office' (are you missing an assembly reference?) 错误 CS0234:命名空间“Microsoft”中不存在类型或命名空间名称“Azure”(您是否缺少程序集引用?) - error CS0234: The type or namespace name 'Azure' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) 命名空间“Microsoft.SqlServer”中不存在类型或命名空间名称“Smo”(您是否缺少程序集引用?) - The type or namespace name 'Smo' does not exist in the namespace 'Microsoft.SqlServer' (are you missing an assembly reference?) 命名空间“Microsoft.AspNetCore”中不存在类型或命名空间名称“Mvc”(您是否缺少程序集引用?) - The type or namespace name 'Mvc' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?) 类型或名称空间名称'PointOfService'在名称空间'Microsoft'中不存在(您是否缺少程序集引用?) - The type or namespace name 'PointOfService' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM