the "Operation is not supported on this platform" error means the function was ported to .net core, but requires O/S support and was not implemented on the selected build target platform. This is most common when the platform is not windows. This is why it's a runtime error.
generally there are better cross platform solutions than the selected method.