Replies: 1 comment 1 reply
-
|
That's strange.
I suggest you provide a minimal repro demonstrating the issue. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I was trying to add a reference to
List<T>for use in a method.with
This works perfectly fine for
net472assemblies. In anetstandard2.1assembly, the code looks fine in ILSpy (with[netstandard]System.Collections.Generic.List`1being shown in IL).However, at runtime, this results in
Could not load type 'System.Collections.Generic.List`1' from assembly 'System.Runtime, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.So it looks like my import is not resolving correctly;
netstandardforwards the type toSystem.Collectionsbut the code is apparently expecting to find it inSystem.Runtimeinstead.What am I missing in order for this to resolve correctly?
I have now worked around it by subclassing
List<T>in my own library, so I avoid the issue (and the generics), but I'd still like to know how to make this work in the "normal" way.Beta Was this translation helpful? Give feedback.
All reactions