For auto copy and replace file, add this to PostBuild command.
In my case is net8.0
xcopy $(OutDir)\runtimes\win\lib\net8.0\System.Management.dll $(OutDir)\System.Management.dll /y