Error MCG0004: InternalAssert Assert Failed to create UWP application in release mode

I have a UWP application written in C # that builds (VS 14.0.25425.01 Update 3 on Windows 10.0.14393, the target version of the project is assembly 14393) and works in debug mode, but does not work in release mode using the following error :

Microsoft.NetNative.targets (640.5): error: MCG0004: InternalAssert Assert Failed: field not found during [UNKNOWN]

No more details, except for two warnings before this, I'm not sure if they are related to the problem:

Resources.System.Linq.Expressions.rd.xml (35): warning: ILTransform: warning ILT0027: Method 'CreateLambda' inside 'System.Linq.Expressions.Expression' not found. Resources.System.Linq.Expressions.rd.xml (91): warning: ILTransform: warning ILT0027: Method 'ParameterIsAssignable' inside 'System.Linq.Expressions.Expression' not found.

Any suggestions that may be related to the problem?

+6
source share
1 answer

This error occurs if you use the Beta package for .NET UWP tools with VS 2015. The beta package is only supported in 2017, as there are changes in the deployment / debugging work that we rely on. You should be able to avoid the problem by downgrading from "Microsoft.NETCore.UniversalWindowsPlatform": "5.3.0-beta2" to "Microsoft.NETCore.UniversalWindowsPlatform": "5.2.2"

edit: 5.3.0 published and works with VS2017 RC3 +. More information here: https://blogs.msdn.microsoft.com/dotnet/2017/01/30/announcing-net-core-net-native-and-nuget-updates-in-vs-2017-rc/

Disclaimer: I am working on a .NET Native team for compiler + runtime.

+5
source

Source: https://habr.com/ru/post/1013582/


All Articles