托管调试助手 "CallbackOnCollectedDelegate":“对“OpenCvSharp!OpenCvSharp.MouseCallback::Invoke
托管调试助手 "CallbackOnCollectedDelegate":“对“OpenCvSharp!OpenCvSharp.MouseCallback::Invoke”类型的已垃圾回收委托进行了回调。这可能会导致应用程序崩溃、损坏和数据丢失。向非托管代码传递委托时,托管应用程序必须让这些委托保持活动状态,直到确信不会再次调用它们
vs2019 ,调试-》调试属性-》生成-》目标平台,x64即可
packages.config
参考配置1:
<?xml version="1.0" encoding="utf-8"?> <packages> <package id="OpenCvSharp4" version="4.8.0.20230708" targetFramework="net472" /> <package id="OpenCvSharp4.Extensions" version="4.8.0.20230708" targetFramework="net472" /> <package id="OpenCvSharp4.runtime.win" version="4.8.0.20230708" targetFramework="net472" /> <package id="OpenCvSharp4.Windows" version="4.8.0.20230708" targetFramework="net472" /> <package id="System.Buffers" version="4.5.1" targetFramework="net472" /> <package id="System.Drawing.Common" version="7.0.0" targetFramework="net472" /> <package id="System.Memory" version="4.5.5" targetFramework="net472" /> <package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net472" /> <package id="System.Runtime.CompilerServices.Unsafe" version="6.0.0" targetFramework="net472" /> </packages>
参考配置2:
<?xml version="1.0" encoding="utf-8"?> <packages> <package id="OpenCvSharp4" version="4.7.0.20230115" targetFramework="net472" /> <package id="System.Buffers" version="4.5.1" targetFramework="net472" /> <package id="System.Memory" version="4.5.4" targetFramework="net472" /> <package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net472" /> <package id="System.Runtime.CompilerServices.Unsafe" version="6.0.0" targetFramework="net472" /> </packages>
欢迎讨论,相互学习。
cdtxw@foxmail.com