You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
using System;
using System.Collections.Generic;
using System.Diagnostics.PerformanceData;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TypeloadRepro
{
class Program
{
static void Main(string[] args)
{
CounterType f = CounterType.AverageCount64;
Console.WriteLine(f);
}
}
}
Run, notices the output
AverageCount64
Try compiling with mono. This type should be in System.Core
C:\Users\UnityAdmin\source\repos\TypeloadRepro\TypeloadRepro>"C:\Program Files\Mono\bin\mcs" /reference:System.Core.dll Program.cs
Program.cs(3,26): error CS0234: The type or namespace name `PerformanceData' does not exist in the namespace `System.Diagnostics'. Are you missin
Compilation failed: 1 error(s), 0 warnings
Try running what was compiled with visual studio and you get a TypeLoadException
Unhandled Exception:
System.TypeLoadException: Could not resolve type with token 01000011 (from typeref, class/assembly System.Diagnostics.PerformanceData.CounterType, System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeLoadException: Could not resolve type with token 01000011 (from typeref, class/assembly System.Diagnostics.PerformanceData.CounterType, System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
Current Behavior
Mono will not compile this code, and libraries/executables built using this type throw TypeLoadException
Expected Behavior
Mono will compile this, and not raise TypeLoadExceptions when libraries/executables use this
On which platforms did you notice this
[ ] macOS
[ ] Linux
[ x] Windows
Version Used:
C:\Users\UnityAdmin\source\repos\EventProviderTraceListenerRepro\EventProviderTraceListenerRepro>"C:\Program Files\Mono\bin\mono.exe" --version
Mono JIT compiler version 5.10.0 (Visual Studio built mono)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: normal
SIGSEGV: normal
Notification: Thread + polling
Architecture: amd64
Disabled: none
Misc: softdebug
Interpreter: yes
LLVM: supported, not enabled.
GC: sgen (concurrent by default)
Our user's project is getting a typeload exception on that enum, but I'd prefer we had the api surface of System.Diagnostics.PerformanceData available and throwing NotImplementedException than missing completely in the case users include other libraries built with .NETFW that may include these types.
https://msdn.microsoft.com/en-us/library/bb156214(v=vs.110).aspx not implemented
Steps to Reproduce
Current Behavior
Mono will not compile this code, and libraries/executables built using this type throw TypeLoadException
Expected Behavior
Mono will compile this, and not raise TypeLoadExceptions when libraries/executables use this
On which platforms did you notice this
[ ] macOS
[ ] Linux
[ x] Windows
Version Used:
Unity Issue Tracker - https://issuetracker.unity3d.com/issues/unity-fails-to-load-net-4-dot-6-assemblies-with-typeloadexception
The text was updated successfully, but these errors were encountered: