✅ Missing compiler required member, .NET 4.7.2
For some reason I can't use dynamics in .net 4.7.2, I've reinstalled the framework to no avail.
Project:
Target frameworks: net7.0;net472
Packages: BenchmarkDotNet (0.13.2)
Language version: latest
22 Replies
Why are you using
dynamic
...why not?
Because C# is a statically typed language
dynamic
removes literally all static safety
DO NOT USE IT unless you have a very good reason to.regardless, why I'm using it is not important
(also, what about reflection?)
In any case, ignoring the fact you shouldn't use it, the mechanisms required for
dynamic
to work are dependent on types in the standard library, types which aren't available in Framework.
Reflection has legitimate uses.
Also why are you using Framework unity
so
dynamic
is just not usable in .net framewok?Nope
huh, thought Unity ran on a higher version than that
And if you're creating a game then the performance impacts
dynamic
has are even less worth it.I mean it isn't that bad
For accessing a member, yes it is
Accessing a field should be practically instant
dynamic
has to do a lot of computation and magic behind the scenes.You know it's a
Program()
so... why use dynamic
at all
It's not like C++'s auto
That'd be var
in C#I know, the code I showed was only for demonstration purposes
That's wrong, you can use dynamic in framework
wha
really? welp, sorry then
But you still shouldn't use it
That's 14 times slower. I'd say that's pretty fucking bad
if you can, then how?
Maybe Unity specifically disallows it, since they run some weird fork of Mono
Probably that
If so, rare Unity W
in the example code I'm not using unity, I just have a benchmarking project
(and I'm on windows)
Well, whatever it is that breaks
dynamic
we should all, collectively, thank itWas this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.