opencvsharp icon indicating copy to clipboard operation
opencvsharp copied to clipboard

Uwp compile error due to "Value type 'OpenCvSharp.Aruco.DetectorParameters' has an explicit default constructor"

Open zhuxb711 opened this issue 1 year ago • 2 comments

Summary of your issue

OpenCvSharp : Gatekeeper error GK0018 : GK0018 Value type 'OpenCvSharp.Aruco.DetectorParameters' has an explicit default constructor which is unsupported. Use an initialization function instead. (Task ID: 1271)

Environment

Universal Windows Platform Visual Studio 2022 Windows 11 22H2 .Net Core 2.0

What did you do when you faced the problem?

4.6.0.20220608 works well but failed in 4.7.0.20230115. This issue only present in publish flow which might be related to .Net Native compilation

zhuxb711 avatar Apr 10 '23 12:04 zhuxb711

Uwp do not support for C# 10.0 (Because of .Net Core 2.0), which is necessary if we want to declare no-parameter constructor in struct. OpenCvSharp.Aruco.DetectorParameters use this feature and which is not supported by Uwp, maybe we could remove the constructor or use conditional compilation to handle this situation for Uwp.

zhuxb711 avatar Apr 10 '23 13:04 zhuxb711

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Dec 15 '23 06:12 stale[bot]