Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error MCG0004:InternalAssert Assert Failed when building UWP app in release mode

I have an UWP app written in C# which builds (VS 14.0.25425.01 Update 3 on Windows 10.0.14393, target version of the project is build 14393) and runs in Debug mode, but fails to build in Release mode with the following error:

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

There are no further details, except for two warnings before, which I am not sure whether they are related to the problem:

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

Any suggestions what the issue could be related to?

like image 670
Christoph Avatar asked Dec 28 '16 17:12

Christoph


1 Answers

This error will occur if you're using the Beta package for .NET UWP tools with VS 2015. The Beta package is only supported on 2017 as there are changes to how deployment/debugging work that we rely on. You should be able to avoid the issue by downgrading from "Microsoft.NETCore.UniversalWindowsPlatform": "5.3.0-beta2" to "Microsoft.NETCore.UniversalWindowsPlatform": "5.2.2"

edit: 5.3.0 has been 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 work on the .NET Native compiler+runtime team.

like image 127
MattWhilden Avatar answered Nov 16 '22 08:11

MattWhilden