StorageFile类成员函数在发布模式下失败 [英] StorageFile Class Member Functions Failing in Release Mode
问题描述
我开发了许多使用StorageFile类的Visual Studio Community 2105 Edition应用程序。
I developed a number of applications Visual Studio Community 2105 Edition which use the StorageFile Class.
他们在调试模式下都运行良好。 当我重新设置Release Mode时,应用程序在我尝试访问文件时崩溃。
They all worked fine in Debug Mode. When I rebuilt them Release Mode the applications crashed when I tried to access files.
当我显示文件选择器以选择要读取的文件时。 应用程序崩溃。 当我尝试保存文件时,应用程序挂起。
When I display a file picker to select a file to read. The applications crash. When I try to save files, the applications hang up.
我注意到在我的机器升级到Windows 10 Creators Edition后不久就开始发生这种情况。
I noticed that this started happening soon after my machine upgrade to Windows 10 Creators Edition.
你能帮忙。
问候
克雷格
推荐答案
嗨克雷格,
欢迎来到MSDN论坛。
请参阅您的描述,看起来您的应用程序是UWP项目。您能否尝试创建一个新的UWP项目并使用Debug或Release
模式构建?
我发现一些其他社区成员遇到了类似的问题,无法使用调试和发布模式构建,在创建者更新后工作正常,
正好 相反。请看一下:
VS 2017 pro将不会推出UWP应用程序在
调试模式
I found some other community members meet the similar issue which is cannot build with debug and release mode works fine after the creator update, which is exactly opposite. Please have a look at this: VS 2017 pro will not launch a UWP app in debug mode
看起来这些问题都引起了通过创建者更新,如果您使用的是C#UWP项目,请尝试使用以下内容:
- 转到属性 - 构建并选中"使用.NET本机工具链编译"选项
- 按照以下步骤重新安装这些软件包,然后再次测试。
- 打开一个提升的PowerShell控制台窗口。
- 运行这些命令(根据您的机器设置调整appx包的路径):
- 附加appxpackage" C:\Program文件(x86)\Microsoft SDKs\Windows Kits\10\ExtensionSDKs\Microsoft.VCLibs\14.0\Appx\Debug\\ \\ x64 \ Microsoft.VCLibs.x64.Debug.14.00.appx"
- 附加appxpackage" C:\Program文件(x86)\Microsoft SDKs\Windows Kits\10\ExtensionSDKs\Microsoft.VCLibs\14.0\Appx\Debug\\ \\ x86 \ Microsoft.VCLibs.x86.Debug.14.00.appx"
- Go to Properties-Build and check the option "Compile with .NET Native tool chain"
- Follow the following steps to re-install those packages, then test it again.
- Open an elevated PowerShell console window.
- Run these commands (adjust the paths to the appx packages as per your machine setup):
- add-appxpackage "C:\Program Files (x86)\Microsoft SDKs\Windows Kits\10\ExtensionSDKs\Microsoft.VCLibs\14.0\Appx\Debug\x64\Microsoft.VCLibs.x64.Debug.14.00.appx"
- add-appxpackage "C:\Program Files (x86)\Microsoft SDKs\Windows Kits\10\ExtensionSDKs\Microsoft.VCLibs\14.0\Appx\Debug\x86\Microsoft.VCLibs.x86.Debug.14.00.appx"
如果此问题仍然存在,请转到帮助 - 发送反馈 - 报告问题以向VS产品团队报告您的问题。如果是,请在此处分享
中的链接,这将有助于其他社区成员遇到同样的问题就知道并追踪这个问题,谢谢你的合作。
最好的问候 ,
Sara
这篇关于StorageFile类成员函数在发布模式下失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!