title: Find the origin of MCG0007 compiler warning
body: <p>I'm trying to compile an uwp app but I get the following error:</p>
  <blockquote>
  <p>Warning       MCG : warning MCG0007: Unresolved P/Invoke method 'ntdll!RtlGetVersion' for method 'System.Int32 Microsoft.DotNet.PlatformAbstractions.Native.NativeMethods.Windows.RtlGetVersion(Microsoft.DotNet.PlatformAbstractions.Native.NativeMethods.Windows.RTL_OSVERSIONINFOEX)'. Calling this method would throw exception at runtime. Please make sure the P/Invoke either points to a Windows API allowed in UWP applications, or a native DLL that is part of the package. If for some reason your P/Invoke does not satisfy those requirements, please use [DllImport(ExactSpelling=true) to indicate that you understand the implications of using non-UWP APIs.</p>
  </blockquote>
  <p>The thing is that I can't find the origin, is there a way to debug this issue? Or how could I find the library that is causing the issue?</p>
  <p>UPDATE: I attach a sample project that throws the same compilation error. If anyone could take a look. I'll be very grateful.</p>
  <p><a href="https://agrovidaec-my.sharepoint.com/:u:/g/personal/sistemas_agrovida_ec/Ec61Olw4KuFOgZS0o7M4iY0BiWX3l_RK02pDZ_RmbOlGHg?e=tjKfsv" rel="nofollow noreferrer">Sample project</a></p>
  <p>UPDATE 2: I have an UWP app that uses the following nuget packages:</p>
  <p>This app uses 3 .netstandard libraries.</p>
  <p>The UWP app contains the following references.</p>
  <pre><code>&lt;PackageReference Include=&quot;AdaptiveCards&quot;&gt;
        &lt;Version&gt;1.2.4&lt;/Version&gt;
      &lt;/PackageReference&gt;
      &lt;PackageReference Include=&quot;MailKit&quot;&gt;
        &lt;Version&gt;2.4.1&lt;/Version&gt;
      &lt;/PackageReference&gt;
      &lt;PackageReference Include=&quot;Microsoft.AppCenter&quot;&gt;
        &lt;Version&gt;2.6.4&lt;/Version&gt;
      &lt;/PackageReference&gt;
      &lt;PackageReference Include=&quot;Microsoft.AppCenter.Analytics&quot;&gt;
        &lt;Version&gt;2.6.4&lt;/Version&gt;
      &lt;/PackageReference&gt;
      &lt;PackageReference Include=&quot;Microsoft.AppCenter.Crashes&quot;&gt;
        &lt;Version&gt;2.6.4&lt;/Version&gt;
      &lt;/PackageReference&gt;
      &lt;PackageReference Include=&quot;Microsoft.Azure.Storage.Blob&quot;&gt;
        &lt;Version&gt;11.1.1&lt;/Version&gt;
      &lt;/PackageReference&gt;
      &lt;PackageReference Include=&quot;Microsoft.NETCore.UniversalWindowsPlatform&quot;&gt;
        &lt;Version&gt;6.2.9&lt;/Version&gt;
      &lt;/PackageReference&gt;
      &lt;PackageReference Include=&quot;Microsoft.Services.Store.Engagement&quot;&gt;
        &lt;Version&gt;10.1901.28001&lt;/Version&gt;
      &lt;/PackageReference&gt;
      &lt;PackageReference Include=&quot;Microsoft.Toolkit.Uwp&quot;&gt;
        &lt;Version&gt;6.0.0&lt;/Version&gt;
      &lt;/PackageReference&gt;
      &lt;PackageReference Include=&quot;Microsoft.Toolkit.Uwp.Notifications&quot;&gt;
        &lt;Version&gt;6.0.0&lt;/Version&gt;
      &lt;/PackageReference&gt;
      &lt;PackageReference Include=&quot;Microsoft.Toolkit.Uwp.UI.Animations&quot;&gt;
        &lt;Version&gt;6.0.0&lt;/Version&gt;
      &lt;/PackageReference&gt;
      &lt;PackageReference Include=&quot;Microsoft.Toolkit.Uwp.UI.Controls&quot;&gt;
        &lt;Version&gt;6.0.0&lt;/Version&gt;
      &lt;/PackageReference&gt;
      &lt;PackageReference Include=&quot;Microsoft.Toolkit.Uwp.UI.Controls.DataGrid&quot;&gt;
        &lt;Version&gt;6.0.0&lt;/Version&gt;
      &lt;/PackageReference&gt;
      &lt;PackageReference Include=&quot;Microsoft.UI.Xaml&quot;&gt;
        &lt;Version&gt;2.3.191211002&lt;/Version&gt;
      &lt;/PackageReference&gt;
      &lt;PackageReference Include=&quot;Microsoft.Xaml.Behaviors.Uwp.Managed&quot;&gt;
        &lt;Version&gt;2.0.1&lt;/Version&gt;
      &lt;/PackageReference&gt;
      &lt;PackageReference Include=&quot;MimeKit&quot;&gt;
        &lt;Version&gt;2.4.1&lt;/Version&gt;
      &lt;/PackageReference&gt;
      &lt;PackageReference Include=&quot;MvvmLight&quot;&gt;
        &lt;Version&gt;5.4.1.1&lt;/Version&gt;
      &lt;/PackageReference&gt;
      &lt;PackageReference Include=&quot;SQLitePCLRaw.bundle_green&quot;&gt;
        &lt;Version&gt;2.0.2&lt;/Version&gt;
      &lt;/PackageReference&gt;
      &lt;PackageReference Include=&quot;SQLitePCLRaw.core&quot;&gt;
        &lt;Version&gt;2.0.2&lt;/Version&gt;
      &lt;/PackageReference&gt;
      &lt;PackageReference Include=&quot;Win2D.uwp&quot;&gt;
        &lt;Version&gt;1.24.0&lt;/Version&gt;
      &lt;/PackageReference&gt;
  </code></pre>
  <p>It uses 3 .netStandard libraries.</p>
  <p>ServicesLibrary</p>
  <pre><code>&lt;PackageReference Include=&quot;itext7&quot; Version=&quot;7.1.9&quot; /&gt;
      &lt;PackageReference Include=&quot;Microsoft.AppCenter&quot; Version=&quot;2.6.4&quot; /&gt;
      &lt;PackageReference Include=&quot;Microsoft.AppCenter.Analytics&quot; Version=&quot;2.6.4&quot; /&gt;
      &lt;PackageReference Include=&quot;Microsoft.Azure.Storage.Blob&quot; Version=&quot;11.1.1&quot; /&gt;
      &lt;PackageReference Include=&quot;Microsoft.Identity.Client&quot; Version=&quot;4.7.1&quot; /&gt;
      &lt;PackageReference Include=&quot;Newtonsoft.Json&quot; Version=&quot;12.0.3&quot; /&gt;
      &lt;PackageReference Include=&quot;Portable.BouncyCastle&quot; Version=&quot;1.8.5.2&quot; /&gt;
      &lt;PackageReference Include=&quot;System.Configuration.ConfigurationManager&quot; Version=&quot;4.7.0&quot; /&gt;
      &lt;PackageReference Include=&quot;System.IO.FileSystem&quot; Version=&quot;4.3.0&quot; /&gt;
      &lt;PackageReference Include=&quot;System.IO.FileSystem.AccessControl&quot; Version=&quot;4.7.0&quot; /&gt;
      &lt;PackageReference Include=&quot;System.ServiceModel.Http&quot; Version=&quot;4.7.0&quot; /&gt;
  </code></pre>
  <p>DataLibrary</p>
  <pre><code>&lt;PackageReference Include=&quot;Microsoft.EntityFrameworkCore&quot; Version=&quot;3.1.0&quot; /&gt;
      &lt;PackageReference Include=&quot;Microsoft.EntityFrameworkCore.Abstractions&quot; Version=&quot;3.1.0&quot; /&gt;
      &lt;PackageReference Include=&quot;Microsoft.EntityFrameworkCore.Analyzers&quot; Version=&quot;3.1.0&quot; /&gt;
      &lt;PackageReference Include=&quot;Microsoft.EntityFrameworkCore.Relational&quot; Version=&quot;3.1.0&quot; /&gt;
      &lt;PackageReference Include=&quot;Microsoft.EntityFrameworkCore.Sqlite.Core&quot; Version=&quot;3.1.0&quot; /&gt;
      &lt;PackageReference Include=&quot;Microsoft.EntityFrameworkCore.SqlServer&quot; Version=&quot;3.1.0&quot; /&gt;
      &lt;PackageReference Include=&quot;Microsoft.Extensions.Logging&quot; Version=&quot;3.1.0&quot; /&gt;
      &lt;PackageReference Include=&quot;Microsoft.Extensions.Logging.Debug&quot; Version=&quot;3.1.0&quot; /&gt;
      &lt;PackageReference Include=&quot;Z.EntityFramework.Extensions.EFCore&quot; Version=&quot;3.0.31&quot; /&gt;
      &lt;PackageReference Include=&quot;Z.EntityFramework.Plus.EFCore&quot; Version=&quot;3.0.31&quot; /&gt;
      &lt;PackageReference Include=&quot;Z.Expressions.Eval&quot; Version=&quot;3.0.11&quot; /&gt;
  </code></pre>
  <p>SigningLibrary</p>
  <pre><code> &lt;PackageReference Include=&quot;BouncyCastle.NetCore&quot; Version=&quot;1.8.5&quot; /&gt;
      &lt;PackageReference Include=&quot;System.Security.AccessControl&quot; Version=&quot;4.7.0&quot; /&gt;
      &lt;PackageReference Include=&quot;System.Security.Cryptography.Pkcs&quot; Version=&quot;4.7.0&quot; /&gt;
      &lt;PackageReference Include=&quot;System.Security.Cryptography.Xml&quot; Version=&quot;4.7.0&quot; /&gt;
      &lt;PackageReference Include=&quot;System.Security.Permissions&quot; Version=&quot;4.7.0&quot; /&gt;
      &lt;PackageReference Include=&quot;System.Security.Principal.Windows&quot; Version=&quot;4.7.0&quot; /&gt;
  </code></pre>
  <p>The UWP references the ServicesLibrary and the DataLibrary, the ServicesLibrary references the SigningLibrary and the DataLibrary. That's the anatomy of the app that I'm trying to compile in release mode.</p>
  <p>Thanks a lot for your help.</p>