OpenCASCADE 7.6.0 not compiling with a .NET 6.0 class library with Visual Studio 2022 (Windows 10)

Steps to reproduce:

1. Install a version of Visual Studio (I used VS Community 2022). Install OpenCASCADE 7.6.0.
2. Create a C++ .NET CLR project using Visual Studio 2022 targeting .net6.0.
3. Change settings to include OpenCASCADE header and library files.
4. Edit the main header by replacing the code within it with below:

#pragma once

//for OCC graphic

//wrapper of pure C++ classes to ref classes

namespace ClrClsLibDotNetCoreMwe {
public ref class Class1
// TODO: Add your methods for this class here.
5. Attempt to build.
Issue: The build fails with the following complain:
1>C:\OpenCASCADE-7.6.0-vc14-64\opencascade-7.6.0\inc\NCollection_DefaultHasher.hxx(34,1): error C2872: 'HashCode': ambiguous symbol
1>C:\OpenCASCADE-7.6.0-vc14-64\opencascade-7.6.0\inc\NCollection_DefaultHasher.hxx(34,1): message : could be 'HashCode'
1>C:\OpenCASCADE-7.6.0-vc14-64\opencascade-7.6.0\inc\NCollection_DefaultHasher.hxx(34,1): message : or 'System::HashCode'
What fixes the problem:

1. Either Targeting .NET Framework instead of .NET Core (/clr instead of /clr:netcore).
2. Or removing one of the headers.
Please see if there is a way where I can keep both the headers and target .NET Core?

I have looked around for a possible solution before posting this question here. A promising solution was to disable implicit usings ( However, that didn't pan out.