I have a Visual studio setup project in my solution. Everything is working fine except the shortcut that I'm trying to add in User's startup folder in order to start the application automatically when the user logs on.
Every link on internet mentions the same procedure that does not work in my case. for example: https://stackoverflow.com/questions/3303962/visual-studio-deployment-project-create-shortcut-to-deployed-executable#:~:text=In%20your%20Deployment%20Project%20go,Rename%20shortcut
The link gets created but it is not working. When I edit the properties of the link, I notice that target is not pointing to an executable. It has the name of the "last" folder where it is installed.
If I create a shortcut manually, it is different:
In the setup project, The only option is to link to the primary output. (When I check the primary output, it has 2 files: file.exe and file.exe.config). I don't know what I'm doing wrong.
Note: this question has been closed as duplicate. But I explained that I followed these articles and they generate in my case a corrupted shortcut.
I select "Primary output from Agent" (see screenshot below). It creates a link object that is incorrect and not pointing to the executable. first Comment from Jiale Xue advises to select the executable and create a shortcut from it. But if you see my screenshot, you'll see that there is no exe to click on. The only selectable object is "Primary output from Agent". And when I select it, it does not work