question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to build release with .Net native toolchain

See original GitHub issue

Description

A project incorporating the OpenXML package will fail to build in Release config if the build is set to use the .Net native toolchain (required for Store submision).

Information

  • Target: UWP
  • DocumentFormat.OpenXml Version: 2.9.0

Repro

  • Create/Open a solution & project and add the OpenXML package
  • Right-click on project in Solution Explorer and select “Properties”
  • With Build selected, choose “Release” for Configuration and “All Platforms” for Platform
  • Ensure “Compile with .Net Native tool chain” is ticked
  • Build the solution for Release/x86

Observed

Build failure: Error MCG0037: MCG0037:InvalidCSharpIdentifierName Struct 'DocumentFormat.OpenXml.Validation.Schema.SdbAttributeConstraint' in assembly 'Assembly(Name=DocumentFormat.OpenXml, Version=2.9.0.0, Culture=neutral, PublicKeyToken=8fb06cb64d019a17)' has a field with name '<AttributeUse>k__BackingField' that is invalid. This could be because the name is obfuscated or the field is auto-implemented by the compiler. Please make sure the field name follows C# identifier conventions.

Expected

Successful build.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
twsouthwickcommented, Mar 14, 2019

This has been uploaded to NuGet as v2.9.1: https://www.nuget.org/packages/DocumentFormat.OpenXml/2.9.1

We don’t have a good process to vet .NET Native builds, so please file any other issues you find. We have it on the backlog (and I now have a sample app) to add support to run the unit tests on .NET Native…

1reaction
twsouthwickcommented, Mar 12, 2019

Thanks for reporting this! I have a fix that we’ll try to get out as quickly as possible (it’ll be 2.9.1).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to compile with .NET Native tool chain (UWP project)
NET Native compiler processes certain types that happen to be used in gRPC. I second @Noemata on this. We are not planing to...
Read more >
UWP Application not building Release mode with .Net ...
I'm currently at a issue where my UWP application will not build/run in Release mode while "Compile with the .NET Native Tool Chain"...
Read more >
[UWP] Compile with "Compile with .NET Native tool chain" ...
As the build works fine after disabling Compile with .Net Native tool chain option. We need our application in Microsoft store and therefore...
Read more >
VS2019 .NET Native Toolchain fails to build as of 16.0.4
In a UWP app, I build in Release mode targeting x64. This worked perfectly until the 16.0.4 update of Visual Studio 2019, ...
Read more >
UWP builds failing with .NetNative compile and WACK Test ...
Hi All, We are trying to make one UWP build targeted for PC with latest installed SDK. We are able to make solution...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found