I am getting this warning in my C++ CLR DLL with Winform in .NetCore 8
warning C4642: 'IHandle': could not import the constraints for generic parameter 'THandle'
warning C4642: 'HandleRef': could not import the constraints for generic parameter 'THandle'
The thing is, even with a very clean project, this warning exist just by default code.
Here are the steps
- Create new project and selecting "CLR Class Library (.NET)"
- Add a new form by going, Add-> New Item-> UI->Window Form
- open the .vcxproj and removed references to
System,
System.Data
System.Drawing
System.Windows.Forms
System.Xml
and replaced with
<FrameworkReference Include="Microsoft.WindowsDesktop.App.WindowsForms" />
Build and Clean and the Warning C4642 appears.
The thing is, this is just a unit test, Our actual project that we ported was originally a Winform C++ CLR app, now built as a DLL and has a C# host to make it work with .netcore 8.
It can be compiled and opened succesfuly.
BUT
We have so many of this warning as we have a LOT of forms is everywhere.
Any idea how to solve this, or should we just suppress this warning?