简体   繁体   English

如何在 Windows Phone 8.1 上禁用本机图像生成?

[英]How to disable Native Image Generation on Windows Phone 8.1?

I've got a c++ application for Windows Phone 8.1, which uses a C# module for xml processing.我有一个适用于 Windows Phone 8.1 的 C++ 应用程序,它使用 C# 模块进行 xml 处理。 The NGEN'd version of that module throws and InvalidCastException from System.StubHelpers.InterfaceMarshaler.ConvertToNative, but the non-NGEN'd version works fine (more details here: http://social.msdn.microsoft.com/Forums/en-US/16fa4316-d0ae-4aca-ac70-9946c6cc4dfb/ngend-dll-throws-exception-but-winmd-does-not?forum=wpdevelop ).该模块的 NGEN 版本从 System.StubHelpers.InterfaceMarshaler.ConvertToNative 抛出和 InvalidCastException,但非 NGEN 版本工作正常(更多详细信息在这里: http ://social.msdn.microsoft.com/Forums/en -US/16fa4316-d0ae-4aca-ac70-9946c6cc4dfb/ngend-dll-throws-exception-but-winmd-does-not?forum=wpdevelop )。

Anyway, as a workaround until I resolve the underlying issue, I would like to simply disable native image generation for my app.无论如何,作为解决潜在问题之前的解决方法,我只想为我的应用程序禁用本机图像生成。 However, the approach suggested on msdn of including a nongen.txt file in the root of the appx does not seem to be working... the file is there, but the C# module still seems to be getting NGEN'd.但是,msdn 上建议的在 appx 的根目录中包含 nongen.txt 文件的方法似乎不起作用......文件在那里,但 C# 模块似乎仍然被 NGEN'd。 Has anyone else run into this / does anyone know how to disable NGEN for an app on Windows Phone 8.1?有没有其他人遇到过这个问题/有没有人知道如何为 Windows Phone 8.1 上的应用程序禁用 NGEN?

I managed to get ahold of a guy from .NET Native who is familiar with the native image generation process.我设法找到了一位熟悉本机图像生成过程的 .NET Native 人员。 Apparently there currently is no way to disable native image generation on Windows Phone.显然,目前无法在 Windows Phone 上禁用本机图像生成。 Here's the full response:以下是完整回复:

"Nongen.txt is not supported on Windows Phone. Technically, NGen doesn't really exist on phone. Native code generation on phone goes through a very different set of steps compared to Windows. There is currently no supported mechanism for skipping native code generation when the app is deployed through Phone app store." “Windows Phone 不支持 Nongen.txt。从技术上讲,手机上并不真正存在 NGen。与 Windows 相比,手机上的本机代码生成经历了一组非常不同的步骤。目前不支持跳过本机代码生成的机制当应用程序通过电话应用程序商店部署时。”

Too bad - that would have been a handy workaround.太糟糕了 - 这将是一个方便的解决方法。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM