dotnet publish -c Release -o publish
copy the contents of the publish/wwwroot folder to your target folder
build dotnet-serve-main. copy dotnet-serve-main.build\bin\dotnet-serve\Debug\net8.0*.* also to the target folder
in the target folder, run dotnet-serve -o