New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploying to Windows Phone fails when using Release build #123

Closed
f-aa opened this Issue Apr 24, 2015 · 16 comments

Comments

Projects
None yet
7 participants
@f-aa

f-aa commented Apr 24, 2015

If you create a project and include the Azure Storage nuget package, you can't build and deploy with Release. It gives the following error:

Error 1 Error : DEP6810 : MdilXapCompile.exe failed with error code 1004. See log file 'C:\Users\Frode\Source\Workspaces\APP PATH\obj\Release\MDIL\MDILXapCompileLog.txt' for more details. PROJECTNAME.WindowsPhone

The file looks like this:

Error: Compile filter argument specified non-existent file: C:\Users\Frode\Source\Workspaces\APP PATH\obj\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.

This seems to be the same problem that the Azure Mobile Services project had (but was fixed in 1.3.1) as referenced here:

https://social.msdn.microsoft.com/Forums/azure/en-US/88920ec1-0088-43d0-8d39-cc3c292fcb9f/offline-data-sample-crashes-on-startup?forum=azuremobile

@pemari-msft

This comment has been minimized.

Show comment
Hide comment
@pemari-msft

pemari-msft Apr 24, 2015

Contributor

Thanks for reporting this! We will try to repro and discuss with Azure Mobile Services and get back to you.

Contributor

pemari-msft commented Apr 24, 2015

Thanks for reporting this! We will try to repro and discuss with Azure Mobile Services and get back to you.

@pemari-msft

This comment has been minimized.

Show comment
Hide comment
@pemari-msft

pemari-msft May 8, 2015

Contributor

Thanks for reporting this issue:

The guidance from the OData team is to follow the workaround in the blog here: http://blogs.msdn.com/b/philliphoff/archive/2014/11/19/missingmanifestresourceexception-when-using-portable-class-libraries-in-winrt.aspx.

  1. In your Windows Phone project, add the WindowsRuntimeResourceManager.cs file given in the above blog.
  2. In the App.xaml.cs file, add the following lines into method `protected override void OnLaunched(LaunchActivatedEventArgs e)', under the DEBUG ifdef:
    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;
        }
        var type = Assembly.Load(new AssemblyName(assemblyName)).GetType(baseName + resourceLoaderSuffix);
        WindowsRuntimeResourceManager.InjectIntoResxGeneratedApplicationResourcesClass(type, baseName);
    }

This should solve your issue in the meantime.

Thanks again for reporting this! Please let us know if you have further questions.

Contributor

pemari-msft commented May 8, 2015

Thanks for reporting this issue:

The guidance from the OData team is to follow the workaround in the blog here: http://blogs.msdn.com/b/philliphoff/archive/2014/11/19/missingmanifestresourceexception-when-using-portable-class-libraries-in-winrt.aspx.

  1. In your Windows Phone project, add the WindowsRuntimeResourceManager.cs file given in the above blog.
  2. In the App.xaml.cs file, add the following lines into method `protected override void OnLaunched(LaunchActivatedEventArgs e)', under the DEBUG ifdef:
    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;
        }
        var type = Assembly.Load(new AssemblyName(assemblyName)).GetType(baseName + resourceLoaderSuffix);
        WindowsRuntimeResourceManager.InjectIntoResxGeneratedApplicationResourcesClass(type, baseName);
    }

This should solve your issue in the meantime.

Thanks again for reporting this! Please let us know if you have further questions.

@f-aa

This comment has been minimized.

Show comment
Hide comment
@f-aa

f-aa May 12, 2015

Excellent. Thank you very much.

f-aa commented May 12, 2015

Excellent. Thank you very much.

@raketenhunddev

This comment has been minimized.

Show comment
Hide comment
@raketenhunddev

raketenhunddev May 14, 2015

@pemari-msft: I tried your suggested steps but I'm still unable to deploy the app on a device. VS stops deploying with the "MdilXapCompile.exe" error message.

In the past I had a similar error with the Azure Mobile Services project. It still deployed to my devices but I got a MissingManifestResource exception at runtime.

I also tried to create an empty universal app and added the storage nuget package. Same here!

Any ideas?

raketenhunddev commented May 14, 2015

@pemari-msft: I tried your suggested steps but I'm still unable to deploy the app on a device. VS stops deploying with the "MdilXapCompile.exe" error message.

In the past I had a similar error with the Azure Mobile Services project. It still deployed to my devices but I got a MissingManifestResource exception at runtime.

I also tried to create an empty universal app and added the storage nuget package. Same here!

Any ideas?

@pemari-msft

This comment has been minimized.

Show comment
Hide comment
@pemari-msft

pemari-msft May 14, 2015

Contributor

Yes, the fix detailed above will solve the MissingManifestResource exception. The exception will only be thrown once the deployment is completed, as you suggest.

The deployment issue should be resolved by copying Microsoft.Data.Edm.resources.dll, Microsoft.Data.Odata.resources.dll, and System.Spatial.resources.dll from the root directory to the de, es, fr, it, ja, ko, ru, zh-Hans, and zh-Hant subdirectories under the ...\obj\Release\MSIL directory, as the log file recommends.

Again, apologies for the inconvenience. Yes, this is the same bug that Mobile Services encountered but unfortunately the codepath causing the issue is in our OData dependency.

Contributor

pemari-msft commented May 14, 2015

Yes, the fix detailed above will solve the MissingManifestResource exception. The exception will only be thrown once the deployment is completed, as you suggest.

The deployment issue should be resolved by copying Microsoft.Data.Edm.resources.dll, Microsoft.Data.Odata.resources.dll, and System.Spatial.resources.dll from the root directory to the de, es, fr, it, ja, ko, ru, zh-Hans, and zh-Hant subdirectories under the ...\obj\Release\MSIL directory, as the log file recommends.

Again, apologies for the inconvenience. Yes, this is the same bug that Mobile Services encountered but unfortunately the codepath causing the issue is in our OData dependency.

@raketenhunddev

This comment has been minimized.

Show comment
Hide comment
@raketenhunddev

raketenhunddev May 15, 2015

Thanks for your fast reply! I'll try copying those files you mentioned next time.

I don't know how to get in contact with the OData dev team. Do you know if they have plans to update the OData project so we don't have to use any workarounds? I think waiting for Win10 for the bug beeing fixed in the .NET Framework ist not a appropiate solution because there will still be developers trying to keep a Win (Phone) 8 compatibility.

raketenhunddev commented May 15, 2015

Thanks for your fast reply! I'll try copying those files you mentioned next time.

I don't know how to get in contact with the OData dev team. Do you know if they have plans to update the OData project so we don't have to use any workarounds? I think waiting for Win10 for the bug beeing fixed in the .NET Framework ist not a appropiate solution because there will still be developers trying to keep a Win (Phone) 8 compatibility.

@melvinga

This comment has been minimized.

Show comment
Hide comment
@melvinga

melvinga Jul 13, 2015

Hope I'm not late for the party.
First off, @pemari-msft , thanks for your effort. You've saved us tonnes of time. A little correction is needed in your code though. For that code which should be written in App.xaml.cs, the last line should have only one argument. The correct version is: WindowsRuntimeResourceManager.InjectIntoResxGeneratedApplicationResourcesClass(type);
and not ...(type, baseName); as you've provided.

Secondly, just so that people can save another minute, the "ResourceManager" (in the cs file titled WindowsRuntimeResourceManager) needs "using System.Resources" and NOT the "...Resources.Core" which is first in the list of suggestions given by visual studio.

Thirdly, our app terminates when it tries to execute resxGeneratedApplicationResourcesClass.GetRuntimeFields().... line in the definition of InjectIntoResxGeneratedApplicationResourcesClass(). Anybody know how to fix this? We don't get any exception messages, the app just terminates in a snap when it starts executing that line. We're blind on why this occurs.

We're running a lot late on my schedule with publishing the app. All help is welcome. :)

melvinga commented Jul 13, 2015

Hope I'm not late for the party.
First off, @pemari-msft , thanks for your effort. You've saved us tonnes of time. A little correction is needed in your code though. For that code which should be written in App.xaml.cs, the last line should have only one argument. The correct version is: WindowsRuntimeResourceManager.InjectIntoResxGeneratedApplicationResourcesClass(type);
and not ...(type, baseName); as you've provided.

Secondly, just so that people can save another minute, the "ResourceManager" (in the cs file titled WindowsRuntimeResourceManager) needs "using System.Resources" and NOT the "...Resources.Core" which is first in the list of suggestions given by visual studio.

Thirdly, our app terminates when it tries to execute resxGeneratedApplicationResourcesClass.GetRuntimeFields().... line in the definition of InjectIntoResxGeneratedApplicationResourcesClass(). Anybody know how to fix this? We don't get any exception messages, the app just terminates in a snap when it starts executing that line. We're blind on why this occurs.

We're running a lot late on my schedule with publishing the app. All help is welcome. :)

@vladkasianenko

This comment has been minimized.

Show comment
Hide comment
@vladkasianenko

vladkasianenko Aug 31, 2015

I still have error.
Empty project. Adding WindowsAzure.Storage ( Microsoft.Data.Edm, Microsoft.Data.OData, System.Spatial ). If I choose x86, everything works fine, but when I choose ARM (real Device), no matter Debug or Release, I cannot deploy -> DEP6810 -> 1004.

If manually create folders in \obj\ARM\Debug\ like de, es, etc. and copying into them Microsoft.Data.Edm.resources.dll, Microsoft.Data.OData.resources.dll, System.Spatial.resources.dll, I can deploy. But when adding code after 'Debug' in OnLaunched method, I have errors:
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;
            }

            try
            {
                var type = Assembly.Load(new AssemblyName(assemblyName)).GetType(baseName + resourceLoaderSuffix);
                WindowsRuntimeResourceManager.InjectIntoResxGeneratedApplicationResourcesClass(type);
            }
            catch(Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("***");
                System.Diagnostics.Debug.WriteLine("\tAssembly: {0}\n\tBaseName: {1}\n\tSuffix: {2}", assemblyName, baseName, resourceLoaderSuffix);
                System.Diagnostics.Debug.WriteLine("***");
                System.Diagnostics.Debug.WriteLine(ex.ToString());
            }
        }

Output:
`
Exception thrown: 'System.IO.FileNotFoundException' in mscorlib.ni.dll
'Chat.exe' (CoreCLR: .): Loaded 'C:\windows\system32\SYSTEM.RUNTIME.NI.DLL'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.


Assembly: Microsoft.Data.Services.Client
BaseName: System.Data.Services.Client
Suffix: .TextRes

'Chat.exe' (CoreCLR: .): Loaded 'C:\windows\system32\en-US\mscorlib.debug.resources.dll'. Module was built without symbols.
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Data.Services.Client, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.Data.Services.Client, Culture=neutral, PublicKeyToken=null'
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.Assembly.Load(AssemblyName assemblyRef)
at Chat.App.OnLaunched(LaunchActivatedEventArgs e)
'Chat.exe' (CoreCLR: .): Loaded 'C:\data\ProgramData\Microsoft\Windows\AppRepository\Packages\4268c21f-2fca-4008-94a9-6346015fbafc_1.0.0.0_arm__nv5h0bq954q3c\NI\Microsoft.Data.OData.ni.DLL'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'Chat.exe' (CoreCLR: .): Loaded 'C:\windows\system32\SYSTEM.CORE.NI.DLL'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'Chat.exe' (CoreCLR: .): Loaded 'C:\windows\system32\en-US\System.Core.debug.resources.DLL'. Module was built without symbols.
Exception thrown: 'System.InvalidOperationException' in SYSTEM.CORE.NI.DLL


Assembly: Microsoft.Data.OData
BaseName: Microsoft.Data.OData
Suffix: .TextRes

System.InvalidOperationException: Sequence contains no matching element
at System.Linq.Enumerable.First[TSource](IEnumerable1 source, Func2 predicate)
at Chat.WindowsRuntimeResourceManager.InjectIntoResxGeneratedApplicationResourcesClass(Type resxGeneratedApplicationResourcesClass)
at Chat.App.OnLaunched(LaunchActivatedEventArgs e)
'Chat.exe' (CoreCLR: .): Loaded 'C:\data\ProgramData\Microsoft\Windows\AppRepository\Packages\4268c21f-2fca-4008-94a9-6346015fbafc_1.0.0.0_arm__nv5h0bq954q3c\NI\Microsoft.Data.Edm.ni.DLL'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Exception thrown: 'System.InvalidOperationException' in SYSTEM.CORE.NI.DLL


Assembly: Microsoft.Data.Edm
BaseName: Microsoft.Data.Edm
Suffix: .EntityRes

System.InvalidOperationException: Sequence contains no matching element
at System.Linq.Enumerable.First[TSource](IEnumerable1 source, Func2 predicate)
at Chat.WindowsRuntimeResourceManager.InjectIntoResxGeneratedApplicationResourcesClass(Type resxGeneratedApplicationResourcesClass)
at Chat.App.OnLaunched(LaunchActivatedEventArgs e)
'Chat.exe' (CoreCLR: .): Loaded 'C:\data\ProgramData\Microsoft\Windows\AppRepository\Packages\4268c21f-2fca-4008-94a9-6346015fbafc_1.0.0.0_arm__nv5h0bq954q3c\NI\System.Spatial.ni.DLL'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Exception thrown: 'System.InvalidOperationException' in SYSTEM.CORE.NI.DLL


Assembly: System.Spatial
BaseName: System.Spatial
Suffix: .TextRes

System.InvalidOperationException: Sequence contains no matching element
at System.Linq.Enumerable.First[TSource](IEnumerable1 source, Func2 predicate)
at Chat.WindowsRuntimeResourceManager.InjectIntoResxGeneratedApplicationResourcesClass(Type resxGeneratedApplicationResourcesClass)
at Chat.App.OnLaunched(LaunchActivatedEventArgs e)`

And then, I cannot create clientBlob despite the fact in x86 everything woks just fine. Any ideas?

vladkasianenko commented Aug 31, 2015

I still have error.
Empty project. Adding WindowsAzure.Storage ( Microsoft.Data.Edm, Microsoft.Data.OData, System.Spatial ). If I choose x86, everything works fine, but when I choose ARM (real Device), no matter Debug or Release, I cannot deploy -> DEP6810 -> 1004.

If manually create folders in \obj\ARM\Debug\ like de, es, etc. and copying into them Microsoft.Data.Edm.resources.dll, Microsoft.Data.OData.resources.dll, System.Spatial.resources.dll, I can deploy. But when adding code after 'Debug' in OnLaunched method, I have errors:
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;
            }

            try
            {
                var type = Assembly.Load(new AssemblyName(assemblyName)).GetType(baseName + resourceLoaderSuffix);
                WindowsRuntimeResourceManager.InjectIntoResxGeneratedApplicationResourcesClass(type);
            }
            catch(Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("***");
                System.Diagnostics.Debug.WriteLine("\tAssembly: {0}\n\tBaseName: {1}\n\tSuffix: {2}", assemblyName, baseName, resourceLoaderSuffix);
                System.Diagnostics.Debug.WriteLine("***");
                System.Diagnostics.Debug.WriteLine(ex.ToString());
            }
        }

Output:
`
Exception thrown: 'System.IO.FileNotFoundException' in mscorlib.ni.dll
'Chat.exe' (CoreCLR: .): Loaded 'C:\windows\system32\SYSTEM.RUNTIME.NI.DLL'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.


Assembly: Microsoft.Data.Services.Client
BaseName: System.Data.Services.Client
Suffix: .TextRes

'Chat.exe' (CoreCLR: .): Loaded 'C:\windows\system32\en-US\mscorlib.debug.resources.dll'. Module was built without symbols.
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Data.Services.Client, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.Data.Services.Client, Culture=neutral, PublicKeyToken=null'
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.Assembly.Load(AssemblyName assemblyRef)
at Chat.App.OnLaunched(LaunchActivatedEventArgs e)
'Chat.exe' (CoreCLR: .): Loaded 'C:\data\ProgramData\Microsoft\Windows\AppRepository\Packages\4268c21f-2fca-4008-94a9-6346015fbafc_1.0.0.0_arm__nv5h0bq954q3c\NI\Microsoft.Data.OData.ni.DLL'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'Chat.exe' (CoreCLR: .): Loaded 'C:\windows\system32\SYSTEM.CORE.NI.DLL'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'Chat.exe' (CoreCLR: .): Loaded 'C:\windows\system32\en-US\System.Core.debug.resources.DLL'. Module was built without symbols.
Exception thrown: 'System.InvalidOperationException' in SYSTEM.CORE.NI.DLL


Assembly: Microsoft.Data.OData
BaseName: Microsoft.Data.OData
Suffix: .TextRes

System.InvalidOperationException: Sequence contains no matching element
at System.Linq.Enumerable.First[TSource](IEnumerable1 source, Func2 predicate)
at Chat.WindowsRuntimeResourceManager.InjectIntoResxGeneratedApplicationResourcesClass(Type resxGeneratedApplicationResourcesClass)
at Chat.App.OnLaunched(LaunchActivatedEventArgs e)
'Chat.exe' (CoreCLR: .): Loaded 'C:\data\ProgramData\Microsoft\Windows\AppRepository\Packages\4268c21f-2fca-4008-94a9-6346015fbafc_1.0.0.0_arm__nv5h0bq954q3c\NI\Microsoft.Data.Edm.ni.DLL'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Exception thrown: 'System.InvalidOperationException' in SYSTEM.CORE.NI.DLL


Assembly: Microsoft.Data.Edm
BaseName: Microsoft.Data.Edm
Suffix: .EntityRes

System.InvalidOperationException: Sequence contains no matching element
at System.Linq.Enumerable.First[TSource](IEnumerable1 source, Func2 predicate)
at Chat.WindowsRuntimeResourceManager.InjectIntoResxGeneratedApplicationResourcesClass(Type resxGeneratedApplicationResourcesClass)
at Chat.App.OnLaunched(LaunchActivatedEventArgs e)
'Chat.exe' (CoreCLR: .): Loaded 'C:\data\ProgramData\Microsoft\Windows\AppRepository\Packages\4268c21f-2fca-4008-94a9-6346015fbafc_1.0.0.0_arm__nv5h0bq954q3c\NI\System.Spatial.ni.DLL'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Exception thrown: 'System.InvalidOperationException' in SYSTEM.CORE.NI.DLL


Assembly: System.Spatial
BaseName: System.Spatial
Suffix: .TextRes

System.InvalidOperationException: Sequence contains no matching element
at System.Linq.Enumerable.First[TSource](IEnumerable1 source, Func2 predicate)
at Chat.WindowsRuntimeResourceManager.InjectIntoResxGeneratedApplicationResourcesClass(Type resxGeneratedApplicationResourcesClass)
at Chat.App.OnLaunched(LaunchActivatedEventArgs e)`

And then, I cannot create clientBlob despite the fact in x86 everything woks just fine. Any ideas?

@pemari-msft

This comment has been minimized.

Show comment
Hide comment
@pemari-msft

pemari-msft Sep 1, 2015

Contributor

I'm not sure we can help further -- the guidance already given in this thread was the information we got back from the CLR and OData teams -- but we can certainly try.

I'm seeing some information about CoreCLR in your stack trace. Can you please share more information about the type of project you're creating, specifically the dll of Azure Storage Client Library that's being pulled in and the project type in Visual Studio that you started with? That will help greatly as I try to repro this again myself.

Contributor

pemari-msft commented Sep 1, 2015

I'm not sure we can help further -- the guidance already given in this thread was the information we got back from the CLR and OData teams -- but we can certainly try.

I'm seeing some information about CoreCLR in your stack trace. Can you please share more information about the type of project you're creating, specifically the dll of Azure Storage Client Library that's being pulled in and the project type in Visual Studio that you started with? That will help greatly as I try to repro this again myself.

@vladkasianenko

This comment has been minimized.

Show comment
Hide comment
@vladkasianenko

vladkasianenko Sep 1, 2015

Hi, thank you for quick response!

  1. File > New Project > Windows Phone 8.1 Store App

  2. With NuGet I'm trying to add WindowsAzure.Storage lib

  3. Nuget asking me for installing these dependencies. But as you can
    see, WindowsAzure.Storage

  4. Here's output:

    Attempting to gather dependencies information for package
    'WindowsAzure.Storage.5.0.1-preview' with respect to project 'App1',
    targeting 'WindowsPhoneApp,Version=v8.1'

    Attempting to resolve dependencies for package
    'WindowsAzure.Storage.5.0.1-preview' with DependencyBehavior 'Lowest'

    Resolving actions to install package
    'WindowsAzure.Storage.5.0.1-preview'

    Resolved actions to install package 'WindowsAzure.Storage.5.0.1-preview'

    For adding package 'Microsoft.Data.Edm.5.6.4' to project 'App1' that
    targets 'wpa81'.

    For adding package 'Microsoft.Data.Edm.5.6.4' to project 'App1' that
    targets 'wpa81'.

    Adding package 'Microsoft.Data.Edm.5.6.4' to folder
    'c:\Users\vlad\documents\visual studio 2015\Projects\Test\App1\packages'

    Added package 'Microsoft.Data.Edm.5.6.4' to folder
    'c:\Users\vlad\documents\visual studio 2015\Projects\Test\App1\packages'

    Added reference 'Microsoft.Data.Edm' to project 'App1'.

    Added package 'Microsoft.Data.Edm.5.6.4' to 'packages.config'

    Added file 'packages.config' to project 'App1'.

    Successfully installed 'Microsoft.Data.Edm 5.6.4' to App1

    For adding package 'System.Spatial.5.6.4' to project 'App1' that targets
    'wpa81'.

    For adding package 'System.Spatial.5.6.4' to project 'App1' that targets
    'wpa81'.

    Adding package 'System.Spatial.5.6.4' to folder
    'c:\Users\vlad\documents\visual studio 2015\Projects\Test\App1\packages'

    Added package 'System.Spatial.5.6.4' to folder
    'c:\Users\vlad\documents\visual studio 2015\Projects\Test\App1\packages'

    Added reference 'System.Spatial' to project 'App1'.

    Added package 'System.Spatial.5.6.4' to 'packages.config'

    Successfully installed 'System.Spatial 5.6.4' to App1

    For adding package 'Microsoft.Data.OData.5.6.4' to project 'App1' that
    targets 'wpa81'.

    For adding package 'Microsoft.Data.OData.5.6.4' to project 'App1' that
    targets 'wpa81'.

    Adding package 'Microsoft.Data.OData.5.6.4' to folder
    'c:\Users\vlad\documents\visual studio 2015\Projects\Test\App1\packages'

    Added package 'Microsoft.Data.OData.5.6.4' to folder
    'c:\Users\vlad\documents\visual studio 2015\Projects\Test\App1\packages'

    Added reference 'Microsoft.Data.OData' to project 'App1'.

    Added package 'Microsoft.Data.OData.5.6.4' to 'packages.config'

    Successfully installed 'Microsoft.Data.OData 5.6.4' to App1

    For adding package 'WindowsAzure.Storage.5.0.1-preview' to project
    'App1' that targets 'wpa81'.

    For adding package 'WindowsAzure.Storage.5.0.1-preview' to project
    'App1' that targets 'wpa81'.

    Adding package 'WindowsAzure.Storage.5.0.1-preview' to folder
    'c:\Users\vlad\documents\visual studio 2015\Projects\Test\App1\packages'

    Added package 'WindowsAzure.Storage.5.0.1-preview' to folder
    'c:\Users\vlad\documents\visual studio 2015\Projects\Test\App1\packages'

    Added reference 'Microsoft.WindowsAzure.Storage' to project 'App1'.

    Added package 'WindowsAzure.Storage.5.0.1-preview' to 'packages.config'

    Successfully installed 'WindowsAzure.Storage 5.0.1-preview' to App1

    ========== Finished ==========

  5. Build (Debug, ARM, Device)

    1> App1 -> c:\users\vlad\documents\visual studio
    2015\Projects\Test\App1\App1\bin\ARM\Debug\App1.exe

    ========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========

  6. Deploy

    1>------ Deploy started: Project: App1, Configuration: Debug ARM ------

    1>Error : DEP6810 : MdilXapCompile.exe failed with error code 1004. See
    log file 'c:\users\vlad\documents\visual studio
    2015\Projects\Test\App1\App1\obj\ARM\Debug\MDIL\MDILXapCompileLog.txt' for
    more details.

    ========== Build: 0 succeeded, 0 failed, 1 up-to-date, 0 skipped

    ========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========

  7. Log file attached

  8. Following #123
    #123, I copied
    Microsoft.Data.Edm.resources.dll, Microsoft.Data.OData.resources.dll and
    System.Spatial.resources.dll from \packages\portable-net45+wp8+win8+wpa
    folder to \obj\ARM\Debug\MSIL

  9. Rebuild and Deploy

    1>------ Rebuild All started: Project: App1, Configuration: Debug ARM

    1> App1 -> c:\users\vlad\documents\visual studio
    2015\Projects\Test\App1\App1\bin\ARM\Debug\App1.exe

    ========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========

    1>------ Deploy started: Project: App1, Configuration: Debug ARM ------

    1>Deploying to Phone Internal Storage...

    1>Creating a new clean layout...

    1>Copying files: Total 11 mb to layout...

    1>Registering the application to run from layout...

    1>Deployment complete (16364ms). Full package name:
    "ad18fc0e-48eb-4716-af86-2738347bb141_1.0.0.0_arm__nv5h0bq954q3c"

    ========== Build: 0 succeeded, 0 failed, 1 up-to-date, 0 skipped

    ========== Deploy: 1 succeeded, 0 failed, 0 skipped ==========

  10. Adding some code, rebuilding and deploy.

    1>------ Rebuild All started: Project: App1, Configuration: Debug ARM

    1> App1 -> c:\users\vlad\documents\visual studio
    2015\Projects\Test\App1\App1\bin\ARM\Debug\App1.exe

    ========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========

  11. Catching Exception

    Exception thrown: 'System.ArgumentOutOfRangeException' in
    Microsoft.WindowsAzure.Storage.ni.DLL

    System.ArgumentOutOfRangeException: The argument
    'ParallelOperationThreadCount' is larger than maximum of '64'

    Parameter name: ParallelOperationThreadCount

    at
    Microsoft.WindowsAzure.Storage.Core.Util.CommonUtility.AssertInBounds[T](String
    paramName, T val, T min, T max)

    at
    Microsoft.WindowsAzure.Storage.Blob.BlobRequestOptions.set_ParallelOperationThreadCount(Nullable`1
    value)

    at Microsoft.WindowsAzure.Storage.Blob.CloudBlobClient..ctor(StorageUri
    storageUri, StorageCredentials credentials)

    at
    Microsoft.WindowsAzure.Storage.CloudStorageAccount.CreateCloudBlobClient()

    at App1.MainPage.<>c.<<Button_Click>b__3_0>d.MoveNext()
    12.

    Adding ParallelOperationThreadCount

    blobClient.DefaultRequestOptions.ParallelOperationThreadCount = 1;

    Still getting this Exception.

But when I use x86 in Emulator, everything works fine.
Here's a link
https://onedrive.live.com/redir?resid=DDBF09D0DF887BE0!420126&authkey=!AIqOSbHDfuoapAE&ithint=file%2czip
to this project in OneDrive.

On 1 September 2015 at 20:41, Peter Marino notifications@github.com wrote:

I'm not sure we can help further -- the guidance already given in this
thread was the information we got back from the CLR and OData teams -- but
we can certainly try.

I'm seeing some information about CoreCLR in your stack trace. Can you
please share more information about the type of project you're creating,
specifically the dll of Azure Storage Client Library that's being pulled in
and the project type in Visual Studio that you started with? That will help
greatly as I try to repro this again myself.


Reply to this email directly or view it on GitHub
#123 (comment)
.

Error: Compile filter argument specified non-existent file: c:\users\vlad\documents\visual studio 2015\Projects\Test\App1\App1\obj\ARM\Debug\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: /Out: /Config: [/CompileFilter:;] [/Timeout:] [/Log:] [/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.

UPD.
For some reasons, GitHub didn't process images that was attached in Email, so I'm gonna add them into .zip file (password: "Azure") in folder "Screenshots" > new link > https://onedrive.live.com/redir?resid=DDBF09D0DF887BE0!420127&authkey=!AOmIGizGk8UTasA&ithint=file%2czip

vladkasianenko commented Sep 1, 2015

Hi, thank you for quick response!

  1. File > New Project > Windows Phone 8.1 Store App

  2. With NuGet I'm trying to add WindowsAzure.Storage lib

  3. Nuget asking me for installing these dependencies. But as you can
    see, WindowsAzure.Storage

  4. Here's output:

    Attempting to gather dependencies information for package
    'WindowsAzure.Storage.5.0.1-preview' with respect to project 'App1',
    targeting 'WindowsPhoneApp,Version=v8.1'

    Attempting to resolve dependencies for package
    'WindowsAzure.Storage.5.0.1-preview' with DependencyBehavior 'Lowest'

    Resolving actions to install package
    'WindowsAzure.Storage.5.0.1-preview'

    Resolved actions to install package 'WindowsAzure.Storage.5.0.1-preview'

    For adding package 'Microsoft.Data.Edm.5.6.4' to project 'App1' that
    targets 'wpa81'.

    For adding package 'Microsoft.Data.Edm.5.6.4' to project 'App1' that
    targets 'wpa81'.

    Adding package 'Microsoft.Data.Edm.5.6.4' to folder
    'c:\Users\vlad\documents\visual studio 2015\Projects\Test\App1\packages'

    Added package 'Microsoft.Data.Edm.5.6.4' to folder
    'c:\Users\vlad\documents\visual studio 2015\Projects\Test\App1\packages'

    Added reference 'Microsoft.Data.Edm' to project 'App1'.

    Added package 'Microsoft.Data.Edm.5.6.4' to 'packages.config'

    Added file 'packages.config' to project 'App1'.

    Successfully installed 'Microsoft.Data.Edm 5.6.4' to App1

    For adding package 'System.Spatial.5.6.4' to project 'App1' that targets
    'wpa81'.

    For adding package 'System.Spatial.5.6.4' to project 'App1' that targets
    'wpa81'.

    Adding package 'System.Spatial.5.6.4' to folder
    'c:\Users\vlad\documents\visual studio 2015\Projects\Test\App1\packages'

    Added package 'System.Spatial.5.6.4' to folder
    'c:\Users\vlad\documents\visual studio 2015\Projects\Test\App1\packages'

    Added reference 'System.Spatial' to project 'App1'.

    Added package 'System.Spatial.5.6.4' to 'packages.config'

    Successfully installed 'System.Spatial 5.6.4' to App1

    For adding package 'Microsoft.Data.OData.5.6.4' to project 'App1' that
    targets 'wpa81'.

    For adding package 'Microsoft.Data.OData.5.6.4' to project 'App1' that
    targets 'wpa81'.

    Adding package 'Microsoft.Data.OData.5.6.4' to folder
    'c:\Users\vlad\documents\visual studio 2015\Projects\Test\App1\packages'

    Added package 'Microsoft.Data.OData.5.6.4' to folder
    'c:\Users\vlad\documents\visual studio 2015\Projects\Test\App1\packages'

    Added reference 'Microsoft.Data.OData' to project 'App1'.

    Added package 'Microsoft.Data.OData.5.6.4' to 'packages.config'

    Successfully installed 'Microsoft.Data.OData 5.6.4' to App1

    For adding package 'WindowsAzure.Storage.5.0.1-preview' to project
    'App1' that targets 'wpa81'.

    For adding package 'WindowsAzure.Storage.5.0.1-preview' to project
    'App1' that targets 'wpa81'.

    Adding package 'WindowsAzure.Storage.5.0.1-preview' to folder
    'c:\Users\vlad\documents\visual studio 2015\Projects\Test\App1\packages'

    Added package 'WindowsAzure.Storage.5.0.1-preview' to folder
    'c:\Users\vlad\documents\visual studio 2015\Projects\Test\App1\packages'

    Added reference 'Microsoft.WindowsAzure.Storage' to project 'App1'.

    Added package 'WindowsAzure.Storage.5.0.1-preview' to 'packages.config'

    Successfully installed 'WindowsAzure.Storage 5.0.1-preview' to App1

    ========== Finished ==========

  5. Build (Debug, ARM, Device)

    1> App1 -> c:\users\vlad\documents\visual studio
    2015\Projects\Test\App1\App1\bin\ARM\Debug\App1.exe

    ========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========

  6. Deploy

    1>------ Deploy started: Project: App1, Configuration: Debug ARM ------

    1>Error : DEP6810 : MdilXapCompile.exe failed with error code 1004. See
    log file 'c:\users\vlad\documents\visual studio
    2015\Projects\Test\App1\App1\obj\ARM\Debug\MDIL\MDILXapCompileLog.txt' for
    more details.

    ========== Build: 0 succeeded, 0 failed, 1 up-to-date, 0 skipped

    ========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========

  7. Log file attached

  8. Following #123
    #123, I copied
    Microsoft.Data.Edm.resources.dll, Microsoft.Data.OData.resources.dll and
    System.Spatial.resources.dll from \packages\portable-net45+wp8+win8+wpa
    folder to \obj\ARM\Debug\MSIL

  9. Rebuild and Deploy

    1>------ Rebuild All started: Project: App1, Configuration: Debug ARM

    1> App1 -> c:\users\vlad\documents\visual studio
    2015\Projects\Test\App1\App1\bin\ARM\Debug\App1.exe

    ========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========

    1>------ Deploy started: Project: App1, Configuration: Debug ARM ------

    1>Deploying to Phone Internal Storage...

    1>Creating a new clean layout...

    1>Copying files: Total 11 mb to layout...

    1>Registering the application to run from layout...

    1>Deployment complete (16364ms). Full package name:
    "ad18fc0e-48eb-4716-af86-2738347bb141_1.0.0.0_arm__nv5h0bq954q3c"

    ========== Build: 0 succeeded, 0 failed, 1 up-to-date, 0 skipped

    ========== Deploy: 1 succeeded, 0 failed, 0 skipped ==========

  10. Adding some code, rebuilding and deploy.

    1>------ Rebuild All started: Project: App1, Configuration: Debug ARM

    1> App1 -> c:\users\vlad\documents\visual studio
    2015\Projects\Test\App1\App1\bin\ARM\Debug\App1.exe

    ========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========

  11. Catching Exception

    Exception thrown: 'System.ArgumentOutOfRangeException' in
    Microsoft.WindowsAzure.Storage.ni.DLL

    System.ArgumentOutOfRangeException: The argument
    'ParallelOperationThreadCount' is larger than maximum of '64'

    Parameter name: ParallelOperationThreadCount

    at
    Microsoft.WindowsAzure.Storage.Core.Util.CommonUtility.AssertInBounds[T](String
    paramName, T val, T min, T max)

    at
    Microsoft.WindowsAzure.Storage.Blob.BlobRequestOptions.set_ParallelOperationThreadCount(Nullable`1
    value)

    at Microsoft.WindowsAzure.Storage.Blob.CloudBlobClient..ctor(StorageUri
    storageUri, StorageCredentials credentials)

    at
    Microsoft.WindowsAzure.Storage.CloudStorageAccount.CreateCloudBlobClient()

    at App1.MainPage.<>c.<<Button_Click>b__3_0>d.MoveNext()
    12.

    Adding ParallelOperationThreadCount

    blobClient.DefaultRequestOptions.ParallelOperationThreadCount = 1;

    Still getting this Exception.

But when I use x86 in Emulator, everything works fine.
Here's a link
https://onedrive.live.com/redir?resid=DDBF09D0DF887BE0!420126&authkey=!AIqOSbHDfuoapAE&ithint=file%2czip
to this project in OneDrive.

On 1 September 2015 at 20:41, Peter Marino notifications@github.com wrote:

I'm not sure we can help further -- the guidance already given in this
thread was the information we got back from the CLR and OData teams -- but
we can certainly try.

I'm seeing some information about CoreCLR in your stack trace. Can you
please share more information about the type of project you're creating,
specifically the dll of Azure Storage Client Library that's being pulled in
and the project type in Visual Studio that you started with? That will help
greatly as I try to repro this again myself.


Reply to this email directly or view it on GitHub
#123 (comment)
.

Error: Compile filter argument specified non-existent file: c:\users\vlad\documents\visual studio 2015\Projects\Test\App1\App1\obj\ARM\Debug\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: /Out: /Config: [/CompileFilter:;] [/Timeout:] [/Log:] [/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.

UPD.
For some reasons, GitHub didn't process images that was attached in Email, so I'm gonna add them into .zip file (password: "Azure") in folder "Screenshots" > new link > https://onedrive.live.com/redir?resid=DDBF09D0DF887BE0!420127&authkey=!AOmIGizGk8UTasA&ithint=file%2czip

@vladkasianenko

This comment has been minimized.

Show comment
Hide comment
@vladkasianenko

vladkasianenko Sep 6, 2015

  1. Open Visual Studio 2013 Community.
  2. Create new Windows Phone 8.1 Store Blank App.
  3. Add WindowsAzure.Storage.
  4. Deploy with this configuration: ARM, Debug, Device.
  5. Then try to deploy with this: ARM, Release, Device.

Something wrong with Release mode.

vladkasianenko commented Sep 6, 2015

  1. Open Visual Studio 2013 Community.
  2. Create new Windows Phone 8.1 Store Blank App.
  3. Add WindowsAzure.Storage.
  4. Deploy with this configuration: ARM, Debug, Device.
  5. Then try to deploy with this: ARM, Release, Device.

Something wrong with Release mode.

@vladkasianenko

This comment has been minimized.

Show comment
Hide comment
@vladkasianenko

vladkasianenko Sep 6, 2015

And the solution is:

  1. Open Build > Configuration Manager
  2. Release, ARM
  3. Uncheck "Build", so VS will deploy "Debug" version into "Release" configuration.

vladkasianenko commented Sep 6, 2015

And the solution is:

  1. Open Build > Configuration Manager
  2. Release, ARM
  3. Uncheck "Build", so VS will deploy "Debug" version into "Release" configuration.
@markaaron

This comment has been minimized.

Show comment
Hide comment
@markaaron

markaaron Oct 7, 2015

Has any team in Microsoft any intention on fixing this ?

markaaron commented Oct 7, 2015

Has any team in Microsoft any intention on fixing this ?

@markaaron

This comment has been minimized.

Show comment
Hide comment
@markaaron

markaaron Oct 8, 2015

p.s I am using windows 10 and Visual Studio 2015 enterprise release version - seems pretty poor its not been addressed yet.

markaaron commented Oct 8, 2015

p.s I am using windows 10 and Visual Studio 2015 enterprise release version - seems pretty poor its not been addressed yet.

@pemari-msft

This comment has been minimized.

Show comment
Hide comment
@pemari-msft

pemari-msft Oct 8, 2015

Contributor

Hi @markaaron,

It's not clear what you're referring to here. Are you talking about the original bug in the runtime? Or Odata? I've addressed it above with a workaround, is that not working for you ?

Contributor

pemari-msft commented Oct 8, 2015

Hi @markaaron,

It's not clear what you're referring to here. Are you talking about the original bug in the runtime? Or Odata? I've addressed it above with a workaround, is that not working for you ?

@rachhek

This comment has been minimized.

Show comment
Hide comment
@rachhek

rachhek Dec 25, 2015

Hello, I used the workaround but I am still getting the same error.

rachhek commented Dec 25, 2015

Hello, I used the workaround but I am still getting the same error.

erezvani1529 added a commit to erezvani1529/azure-storage-net that referenced this issue Oct 4, 2017

Merge pull request Azure#123 from jofriedm-msft/dev
[8.4] Public Dev to Private Dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment