Thanks for the idea with Task.detached. It made no change however. Please check the video below. You can see that when I start dragging the text, the loop prints the numbers in the background. Only when this is finished I can see the drag preview and the + sign to indicate open-in-place. When I drop before this preview is shown nothing happens. When it is shown (in other words, the loop has finished), then it works.
In the end, what I want to achieve is that I can drag a URL promise to another application that only accepts file URLs as drop type. As long as the file does not exist (shall be created either when I start dragging, or when dropped to the target application), I want to show a some kind of loading indicator in my app.
I have uploaded the code of my drag test application here: https://github.com/sarensw/DragTest. It contains all variants that I have tried so far (nothing works as of now). The one that I asked about in this post is UsingNSItemProvider1. I'm currently playing around with UsingNSViewRepresentable