Closed msfreed closed 11 months ago
This seems related to #282, looking at the files: https://github.com/ardalis/GuardClauses/pull/282/files, they just simply changed the build target to net7
, forcing net6
to use netstandard2.0
which doesn't have the CallerArgumentExpression
implementations.
I guess it's up to the maintainers to decide whether they want to support net6
, perhaps having a netstandard2.1
version for older versions that support CallerArgumentExpression
.
@ardalis, what do you think?
One possible fix: https://stackoverflow.com/a/70034587/13729
Does netstandard2.1
have support for CallerArgumentExpression
? I don't really want to drop netstandard2.0
support since I know many projects leverage that, but maybe it's worth adding another target for 2.1.
Of course I expect most folks on net6 to jump to net8 quickly which will also eliminate this issue, I think.
One possible fix: https://stackoverflow.com/a/70034587/13729
Does
netstandard2.1
have support forCallerArgumentExpression
? I don't really want to dropnetstandard2.0
support since I know many projects leverage that, but maybe it's worth adding another target for 2.1.
Don't really know. In fact now you question it, I don't think so. It's supported bij netcore3.1 so probably not.
About the possible fix, I've used similar things to this in a library of mine. It works fine, however I'm not sure it'll make it through outside of your code base. I'm happy to test with an alpha build.
Of course I expect most folks on net6 to jump to net8 quickly which will also eliminate this issue, I think.
Well, with the speed of how some people upgrade I'm not planning to drop net6 from my library yet. I'm probably not the only one, and it'll probably have a domino effect.
I won't be quickly jumping to .Net 8 until it's been out and proven for a while. We still have support for .Net 6 for a bit longer and it would be great to fix this!
Is this related/the same as my question #290?
@ardalis I decided to try out your suggestion. It worked locally so I made a PR: #303. Please have a look.
Targeting net6.0, as of v4.1.0 the optional
parameterName
is no longer available. This works in v4.0.1.Steps to Reproduce:
NullOrWhiteSpace
(for example)