I\'m in the process of moving some code from .NET (4.5) to .NET Core (2) and have a multi-targeted project like so...
It does not have anything to do with the framework you target, it is the bitness of the process that matters. A .NET 4.5 project starts life with the Project > Properties > Build tab > "Prefer 32-bit" checkbox turned on. .NETCore favors 64-bit code heavily and makes you jump through a hoop to get the 32-bit runtime.
CopyMemory() is olden, dates back to early 16-bit Windows versions. They had to retain it for the 32-bit winapi, there are lots of VBx programs that use it. But put their foot down for the 64-bit. Otherwise well documented in the MSDN article: "This function is defined as the RtlCopyMemory function. Its implementation is provided inline. For more information, see WinBase.h and WinNT.h". Which are worth a look, you'll see what "inline" means. The RtlCopyMemory isn't actually being used either, substituting it with memcpy() instead.
So just use RtlCopyMemory instead for either flavor. Do keep in mind that it can't work when you deploy on Linux or MacOS.