Simple examle of using PInovoke in .Net Core
Go to cpp folder and execute make
Download .NET Core SDK
And then run (ubuntu example)
dotnet build --runtime ubuntu.16.04-x64 -c Release
Go to Release folder and copy C++ library object there and then run the binary