I thought it might have been a VB code issue but it might be a VS setup issue that makes it not possible to publish install file.
https://docs.microsoft.com/en-us/answers/questions/437602/could-debug-a-application-and-test-it-but-could-no.html?childToView=465726#comment-465726