【问题标题】:The type or namespace name 'Windows' could not be found找不到类型或命名空间名称“Windows”
【发布时间】:2017-11-10 15:17:59
【问题描述】:

我正在尝试为我的 hololens 应用程序使用文件选择器。但我无法使用它,因为我的项目无法添加“windows”引用。

当我写using Windows.Storage

The type or namespace name 'Windows' could not be found -- 此错误信息在 Windows 下出现红线。

我尝试使用引用管理器添加引用,但在程序集 - 框架中找不到任何东西,例如 Windows。

谁能帮我解决这个问题?谢谢!

【问题讨论】:

  • 什么项目类型?
  • 重申@SLaks - 什么类型的项目?我能够启动一个 Unity 3D 项目,添加一个脚本并且我可以访问 Windows.Storage; -- 与启动新的空白 UWP 应用程序相同。让我们知道,并乐于提供帮助。 :)
  • @SLaks 谢谢,应用程序 - 输出类型表示类库。是这个原因吗?
  • @LanceLarsen 谢谢,应用程序 - 输出类型表示类库。是这个原因吗?
  • 如果您将 8.1 替换为 Windows 版本,Manohar Reddy Poreddys answer 可以完美运行。

标签: c# visual-studio hololens filepicker


【解决方案1】:

我缺少 Win 8.1 SDK,所以出现错误。

以下步骤解决了我的问题:

Download and Start the "Visual Studio installer"  
  Click on the "Modify" button  
    Click "Individual components" tab  
    Under "SDKs, libraries and frameworks" heading  
      Select "Windows 8.1 SDK" (replace 8.1 with your Windows version.)  
      Click "Modify" to install  

希望对您有所帮助。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-07-12
    • 2011-05-13
    • 2013-03-25
    • 2012-06-19
    • 2017-11-29
    • 2012-09-27
    • 2011-05-06
    相关资源
    最近更新 更多