TypeLoadException
- Dominant language
- C#
- Stars
- 707
- Forks
- 45
- PR merge metrics
- No merged PRs in 30d
Description
Visual Studio 2019 Preview 3.0
.NET Core 3.0 Console Application
Code to reproduce:
```csharp
using System;
using System.Runtime.Intrinsics.X86;
namespace ConsoleApp1
{
class Program
{
static unsafe void Main(string[] args)
{
Console.WriteLine("Hello World!");
DoTest();
Console.WriteLine($"Is sup: {Sse42.IsSupported}");
}
static unsafe void DoTest()
{
var srcBuf = stackalloc[] { (byte)0xF0, (byte)0xF0, (byte)0xF0, (byte)0xF0 };
var dstBuf = stackalloc[] { (byte)0xF0, (byte)0xF0, (byte)0xF0, (byte)0xF0 };
var cvrBuf = stackalloc[] { (byte)0xF0, (byte)0xF0, (byte)0xF0, (byte)0xF0 };
var alphaBuf = stackalloc[] { (byte)0xF0, (byte)0xF0, (byte)0xF0, (byte)0xF0 };
var csmBuf = stackalloc[]
{
(byte)0x00,
(byte)0xFF,
(byte)0xFF,
(byte)0xFF,
(byte)0x01,
(byte)0xFF,
(byte)0xFF,
(byte)0xFF,
(byte)0x02,
(byte)0xFF,
(byte)0xFF,
(byte)0xFF,
(byte)0x03,
(byte)0xFF,
(byte)0xFF,
(byte)0xFF
};
var onesBuf = stackalloc[]
{
(byte)0x01,
(byte)0x00,
(byte)0x00,
(byte)0x00,
(byte)0x01,
(byte)0x00,
(byte)0x00,
(byte)0x00,
(byte)0x01,
(byte)0x00,
(byte)0x00,
(byte)0x00,
(byte)0x01,
(byte)0x00,
(byte)0x00,
(byte)0x00,
};
var length = 4;
var rCvr = Sse42.LoadVector128(cvrBuf);
var rSrc = Sse42.LoadVector128(srcBuf);
for (int i = 0; i < length; i++)
{
rCvr = Sse42.Shuffle(rCvr, Sse42.LoadVector128(csmBuf));
rCvr = Sse42.Add(rCvr, Sse42.LoadVector128(onesBuf));
}
}
}
}
```
"Disasm 'DoTest' method" fails with:
```
Unhandled Exception: System.TypeLoadException: Could not load type 'Internal.Runtime.Augments.EnvironmentAugments' from assembly 'System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'.
at System.Environment.get_CurrentManagedThreadId()
at System.Linq.Enumerable.Where[TSource](IEnumerable`1 source, Func`2 predicate)
at ConsoleApp1.Program.Main(String[] args)
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.