❔ TargetFramework for targeting both Framework and Core
What's the
TargetFramework
you should use if you want interoperability with both Framework and Core? I think netstandard2.0
or netstandard2.1
, right? This is for a project which has to target Framework 4.8.32 Replies
right
hmm
4.0?
actually 4.8
netstandard 2.1
According to this, .NET Standard 2.1 doesn't support Framework at all
https://learn.microsoft.com/en-us/dotnet/standard/net-standard?tabs=net-standard-2-1
.NET Standard
Learn about .NET Standard, its versions, and the .NET implementations that support it.
Standard 1.1 supports netfx 4.8... although it's missing so much stuff
I'd use NS2.0
Would that work with 4.8?
2.0 yes
That says 4.6.1 tho
oh
lol I can read
xd
or can't do math
Only issue now is the fact things like
Math.Log2
is missing Definitely ns2.0, but I'd first try to make sure that I super extreemely have to target Fx
This is for a mod targeting a game which runs on netfx 4.5 although which somehow has compatibility with 4.8
There are polyfills for most things, and then there are hacks for others
You can write log2 based on the log you have so that should be no problem
Yeah I've already polyfilled STJ, System.Drawing, and a couple other things
There's also PolySharp
Already have that
As an alternative, you could multitarget to get some enhanced experience while coding
Mainly null-checks and such
that way you can do like:
#if NET48
bla
#elife NET7
bla bla
?
Yes but I don't advise it for conditional compilation
But because analysis becomes better when NRT annotations and friends aren't just polyfilled
ah nice, gotcha
Luckily source dot dot dot net exists, aka. copying the source implementation
wat
whats the point of netstandard then
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
"Given many of the API additions in .NET Standard 2.1 require runtime changes in order to be meaningful, .NET Framework 4.8 will remain on .NET Standard 2.0 rather than implement .NET Standard 2.1. .NET Core 3.0 as well as upcoming versions of Xamarin, Mono, and Unity will be updated to implement .NET Standard 2.1."
???
https://github.com/dotnet/standard/issues/859
mono
mono supports netstandard2.1
which means unity, xamarin, and a few other things
Was 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.