1
votes

I have this app, that builds and runs successfully in Debug mode, on both my local computer and on my Windows Phone device, when trying with the Release mode, I get these 3 errors :

Error Internal compiler error: One or more errors occurred.

The non-generic type 'PInvoke.NTSTATUS.Code__PInvoke_Windows_Core' cannot be used with type arguments ...obj\x64\Release\ilc\intermediate\Liberte.Windows.Interop\SafeTypes.g.cs 333

The type or namespace name 'Value' could not be found (are you missing a using directive or an assembly reference?) ...obj\x64\Release\ilc\intermediate\Liberte.Windows.Interop\SafeTypes.g.cs 333

The actual code where the two last errors are detected is an auto generated code under a file named SafeTypes.g.cs and the line where the errors is raised is :

namespace PInvoke
{
    [global::System.Runtime.InteropServices.McgRedirectedType("PInvoke.NTSTATUS,PInvoke.Windows.Core, Version=0.1.0.0, Culture=neutral, PublicKeyToken=9e300f9f87f04a7a")]
    public unsafe partial struct NTSTATUS__PInvoke_Windows_Core
    {
        public global::PInvoke.NTSTATUS.Code__PInvoke_Windows_Core <Value>k__BackingField;
    }
}

I don't have any idea what does this mean, nor what should I do, any explanation and solution to this ?

Update :

Tried to Close VS, then Delete the Obj and the Bin content, rebuild again, but stuill have the same error.

I should mention maybe that I have reference to 2 other projects, one of them is a PCL project that uses PCLCrypto library, and the other one is a Universal App library that uses EntityFramework 7 pre-release with sqlight.

Update 2:

I tried to disable compilation with .Net native just to see what goes on, the release build succeeds, but the App crashes and quits just after startup.

Update 3:

I just discovered that the PCLCrypto library that I use in one of the two project I'm referencing, references two libs that are causing the problem, and they are mentioned in the errors above, I found this out when trying to uninstall the library to see if it is the cause of the problem :

enter image description here

I tried to rollback to a previous stable version, compiled in Debug mode, everything worked perfectly, when I try again Release mode with .Net native, I encounter a new problem : Out of memory.

1
You should try close VS, delete /obj and /bin folder in Project root directory, then rebuild solutionHelloWindowsPhone
@new01bie : thx for answering me, please check my updateAymenDaoudi
Do you use .Net Native in Release mode? If "yes" - try remove it (in properties of main project) and try you way again.Mykyta Bondarenko
@NikitaBondarenko thx for your comment, I've just tried that, the build succeeds, but that app crashes just after startup, any idea ??AymenDaoudi
Is the same exception or another? Any errors in Output window? You say that "the App crashes and quits just after startup" - after what? After constructor in App.cs or after navigating to first (main) page?Mykyta Bondarenko

1 Answers

0
votes

Concerning Update 3, it seems to be a bug with .NET Native tool chain, I opened an issue on PCLCrypto repo that was moved to corert repo