title: MethodAccessException is thrown in Release build created with MSBuild
body: <p>I have the following set of assemblies: Program.exe, Lib1.dll, Lib2.dll, SkiaSharp.dll running on .NET 4.5.</p>
  
  <p>Program.Main calls Lib1.Method1, Lib1.Method1 calls Lib2.Method2, Lib2.Method2 calls Lib2.Method3, Lib2.Method3 calls SkiaSharp.Method. All methods are public, language used is C#.</p>
  
  <p>When Lib2 is built in Release mode using Visual Studio 2017 everything works.<br/> When Lib2 is built in Release mode from command line using MSBuild the following exception is thrown at runtime: System.MethodAccessException: Attempt by method 'Lib2.Method2' to access method 'Lib2.Method3' failed.</p>
  
  <p>The MSBuild command line is simple:</p>
  
  <pre><code>MsBuild.exe Lib2.csproj /t:Rebuild /verbosity:quiet /p:Configuration=Release;Platform=AnyCPU;DefineConstants="TRACE;WIN";OutputPath=bin\Release\
  </code></pre>
  
  <p>How can I perform a build using MSBuild the same way Visual Studio does?</p>