ZXing.Net icon indicating copy to clipboard operation
ZXing.Net copied to clipboard

Pure Netstandard Release / Nullable Annotations

Open Blackclaws opened this issue 3 years ago • 1 comments

First and foremost, a big thank you for this project. We've been using it for a while now.

Recently we noticed that there are issues that crop up when using the current version of zxing.unity with later versions of unity (2021.2+) which a rebuild which targets netstandard seem to resolve (the error is that the static constructor for Zxing.Common.StringUtils throws a null reference exception on IL2CPP targets).

Therefore a general question would be whether a pure netstandard release with various companion Binding libraries is planned for the future.

There is nothing aside from the standard Luminance Sources that take bitmaps that is really .net framework specific and those targets could still be built using different projects as is done already.

While we're at it annotating the library with nullable reference types would also be a big benefit in usability (imho) as it allows clear checks for null reference exceptions at compile time already. I also think nullable reference types are just ignored by the compiler if targeting an older framework release but I'm not a hundred percent sure.

Blackclaws avatar Feb 14 '22 11:02 Blackclaws

Which version of ZXing.Net are you using? The NullRef should be fixed with version 0.16.8.

There are already different versions for .Net standard available. What are the benefits to have a pure standard release? If I would do so I know what's coming next: one minute later I will have a ton of new issues asking for a build for a specific .Net platform ;) Btw. it should be possible to throw away the specific zxing.unity.dll build. You can use the .net standard version and the specific unity binding. But you have to download the binding manually from the download section because there is no nuget package available.

Do you have some small examples which show where you would like to see nullable reference types?

micjahn avatar Feb 15 '22 06:02 micjahn