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
-
I was trying to add a reference to
List<T>
for use in a method.with
This works perfectly fine for
net472
assemblies. In anetstandard2.1
assembly, the code looks fine in ILSpy (with[netstandard]System.Collections.Generic.List`1
being 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;
netstandard
forwards the type toSystem.Collections
but the code is apparently expecting to find it inSystem.Runtime
instead.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