Unable to build release with .Net native toolchain
See original GitHub issueDescription
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:
- Created 5 years ago
- Comments:6 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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…
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).