c# - WindowsPhone - DEP6810: MdilXapCompile.exe失败,错误码为1004

本文关键字:错误 误码 1004 失败 exe WindowsPhone DEP6810 MdilXapCompile | 更新日期: 2023-09-27 18:10:31

我刚刚为Windows Phone 8.1商店应用创建了一个新的空项目。然后加入WindowsAzure.Storage。当我试图将这个项目部署到我的真实手机与选定的选项(发布,ARM),我得到这个错误:

Error : DEP6810 : MdilXapCompile.exe failed with error code 1004. See log file '...'obj'ARM'Release'MDIL'MDILXapCompileLog.txt' for more details.

这是:

Error: Compile filter argument specified non-existent file: C:'Users'vlad'Documents'Visual Studio 2015'Projects'App1'App1'obj'ARM'Release'MSIL'de'Microsoft.Data.Edm.resources.dll
Invalid argument
Microsoft (R) MDIL XAP Compiler - Version 4.0.0.0
Copyright (c) Microsoft Corporation.  All rights reserved.
Usage: MDILXAPCompile /In:<InputPath> /Out:<OutputPath> /Config:<ConfigPath> [/CompileFilter:<Assembly Path>;<Assembly Path>] [/Timeout:<Timeout>] [/Log:<LogPath>] [/AppX]
/In     - Path to directory containing files to process
/Out        - Path to directory to place processed files in
/Config     - Path to configuration file
/CompileFilter  - Optional restrictive list of assembly files in InputPath,
          separated by semi-colons, to be compiled.
/Timeout    - Optional timeout in milliseconds before killing the Crossgen process. Overrides config file timeout value. Use -1 for infinite timeout, 0 for application default (2 hours).
/Log        - Optional path to log file
/AppX       - Specifies that assemblies correspond to an AppX package
Relative paths are relative to this executable's directory.

我可以部署这个应用程序,如果我手动创建文件夹de, es等在MSIL文件夹和复制Microsoft.Data.Edm.resources.dll, Microsoft.Data.OData.resources.dllSystem.Spatial.resources.dll到每个文件夹。

但是当我调用await blockBlob.UploadFromFileAsync(file);时,我的应用程序刚刚关闭。try {} catch(Exception ex) {} - no result.

应用程序在调试-x86在模拟器中工作出色,但为什么我不能使此代码在ARM上运行?如果我甚至不能部署应用程序,我怎么能在应用程序中使用Azure呢?


看起来他们在某个地方使用本地化资源,但我如何修复它使其在ARM上可用?


UPD1 -这个解决方法没有意义-我有4个例外。

string[] resourceBaseNames = new string[]
            {
                "System.Data.Services.Client",
                "Microsoft.Data.OData",
                "Microsoft.Data.Edm",
                "System.Spatial",
            };
            foreach(var baseName in resourceBaseNames)
            {
                string assemblyName = baseName;
                string resourceLoaderSuffix = ".TextRes";
                switch(baseName)
                {
                    case "System.Data.Services.Client":
                        assemblyName = "Microsoft.Data.Services.Client";
                        break;
                    case "Microsoft.Data.Edm":
                        resourceLoaderSuffix = ".EntityRes";
                        break;
                }
                System.Diagnostics.Debug.WriteLine("Assembly: {0}, baseName: {1}, suffix: {2}", assemblyName, baseName, resourceLoaderSuffix);
                try
                {
                    var type = Assembly.Load(new AssemblyName(assemblyName)).GetType(baseName + resourceLoaderSuffix);
                    WindowsRuntimeResourceManager.InjectIntoResxGeneratedApplicationResourcesClass(type);
                }
                catch(Exception ex)
                {
                    System.Diagnostics.Debug.WriteLine(ex.ToString());
                }
            }

c# - WindowsPhone - DEP6810: MdilXapCompile.exe失败,错误码为1004

这实际上是运行时本身的一个已知问题,它受到Azure存储依赖项(OData库)的影响。

请参阅https://github.com/Azure/azure-storage-net/issues/123了解有关此错误和临时解决方案的更多信息。

在我的例子中,我删除了不必要的nuget包(如Microsoft.Data)。OData Microsoft.Data。Edm 体系认证。空间WindowsAzure.Storage)从WP客户端,这个错误为我解决了。您可能希望从WP客户端使用Azure存储服务。但我更喜欢使用restful web服务而不是WP客户端。因此,我将Azure存储代码放到web服务中,并从WP客户端使用这些服务。