2016-08-04 77 views
2

Plase未發現異常,幫幫我,我的代碼在C#下面的行內的一些異步方法,我使用通用的Windows平臺(Windows 10 SDK 10.0.14393):文件在通用Windows平臺

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

問題是這種異常:mscorlib.ni.dll中發生System.IO.FileNotFoundException。

Visual Studio顯示我,該文件位於Assets文件夾內,並且文件正常,因爲它通常打開(這是非常短的json文件)。這個問題有什麼問題或解決方案?

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

回答

3

更改BuildActionContentCopy to Output DirectoryDo not copyAwayls

enter image description here

相關問題