Hi @krishna ,
Welcome to Microsoft Q&A forum.
It doesn’t work with .NET Framework 4.7.2 based projects. According to this thread: Publish a single file app does not create a single file and this link(.NET 5), you may need to use .NET 6 Preview or higher versions of .NET to make it work.
BTW, based on my test, by using .NET 6, if you choose framework-dependent to publish, you will get two files(.exe, .pdb). If you choose Self-Contained to publish, you will still get some(not a single file) files. I suggest you post this question on GitHub – dotnet if you change to use .NET 6 but get the same issue.
Best Regards,
Tianyu
- If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.