When debugging my app it works fine i.e. It gets the two commandline args, through a loop, and execute as expected. However, once I publish it, the app only picks up the first argument, which is the .exe file string. What am I doing wrong here? Plz help. Code below:
_____________________________________________________

Public Sub Main()

Dim args() As String = Environment.GetCommandLineArgs()

Dim n As integer = args.Length
Dim i as integer

MsgBox("No of args is:" & n)

While i < n

_ _ _


Next

End Sub

(passed args as: -a -k, in the File Debug Properties)

n is 3 in Debug mode and 1 after publishing the app. Why?
____________________________________________

Thanks for helping.