【问题标题】:File Not Found Exception in Universal Windows Platform通用 Windows 平台中未找到文件异常
【发布时间】:2016-08-04 19:51:24
【问题描述】:

请帮帮我,我在 C# 中的一些异步方法中有以下代码行,并且我使用通用 Windows 平台(Windows 10 SDK 10.0.14393):

var file = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///Assets/HamburgerMenuItems.json"));

问题是这个异常:System.IO.FileNotFoundException发生在mscorlib.ni.dll中。

Visual Studio 向我展示了该文件位于 Assets 文件夹中并且文件正常,因为它可以正常打开(它是非常短的 json 文件)。可能是什么问题或这个问题的解决方案是什么?

this image shows, that the file is inside the Assets folder

【问题讨论】:

    标签: c# windows exception windows-10-universal


    【解决方案1】:

    将BuildAction 更改为Content 和Copy to Output Directory 从Do not copy 更改为Awayls。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-03-29
      • 2019-06-26
      • 2012-01-06
      • 1970-01-01
      • 1970-01-01
      • 2013-04-19
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多