I have creating .NET applications to access GPIO, SPI, I2C, UART for the UP Boards for Windows 10 IoT Enterprise. There are a couple of items needed:
First, RHPROXY has to be supported in the UEFI firmware. I wrote an article about access these IO and the need for RHPOXY support: Industrial PC Requirements to Access GPIO/I2C/SPI/UART from Windows 10 UWP. Even though the paper calls out IoT Core, it is the same supported needed for IoT Enterprise. You will have to work with your hardware vendor to make sure RHPROXY is included.
Second, for .NET Core 3.1 and .NET 6, you will need to add the Microsoft.Windows.SDK.Contracts NuGet Package in order to gain access to the Windows.Devices.Gpio namespace. yes, the namespace is for UWP, but the NuGet packages opens the namespace for .NET WPF apps.