Skip to content

Commit

Permalink
ILCompiler.Reflection.ReadyToRun has to target netstandard2.0 for ILS…
Browse files Browse the repository at this point in the history
…py usage (#57416)
  • Loading branch information
cshung committed Aug 14, 2021
1 parent b3bb5db commit 0ebc7ec
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<AssemblyKey>Open</AssemblyKey>
<IsDotNetFrameworkProductAssembly>true</IsDotNetFrameworkProductAssembly>
<TargetFramework>$(NetCoreAppToolCurrent)</TargetFramework>
<!-- ILSpy requires this assembly to target netstandard2.0 -->
<TargetFramework>netstandard2.0</TargetFramework>
<CLSCompliant>false</CLSCompliant>
<NoWarn>8002,NU1701</NoWarn>
<RuntimeIdentifiers>win-x64;win-x86</RuntimeIdentifiers>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1163,7 +1163,12 @@ public Guid GetAssemblyMvid(int assemblyIndex)
return Guid.Empty;
}
int mvidOffset = GetOffset(mvidSection.RelativeVirtualAddress) + GuidByteSize * assemblyIndex;
return new Guid(new ReadOnlySpan<byte>(Image, mvidOffset, ReadyToRunReader.GuidByteSize));
byte[] mvidBytes = new byte[ReadyToRunReader.GuidByteSize];
for (int i = 0; i < mvidBytes.Length; i++)
{
mvidBytes[i] = Image[mvidOffset + i];
}
return new Guid(mvidBytes);
}
else
{
Expand Down

0 comments on commit 0ebc7ec

Please sign in to comment.