Link to home
Start Free TrialLog in
Avatar of Michael Sterling
Michael SterlingFlag for United States of America

asked on

Why does my 1st command line argument show up as a path to vshost.exe?

I'm building a desktop application in VS 2012 C#. While testing the applcation, I'm reading in commmand line arguments that i've set in the debug section of the application properties. I've only set 4 values (each separated by a space). However, when, in my code I attempt to access args[0], it is not the first argument that i've put in, its the path on my machine that leads to the vshost.exe file in the debug directory of my application file structure. Why is this and how do I prevent this from happening? I really want my 1st argument to be what I have typed into the debug section of the application properties.
ASKER CERTIFIED SOLUTION
Avatar of Fernando Soto
Fernando Soto
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Michael Sterling

ASKER

Ok. I was just wondering. In a much older VB version of my app. (I'm rewriting it in C#) there first arg is actually what they've typed into the command line arguments in the debug properties of the app, so I was just curious as to why mine wasn't. Which version of VS did they make this a rule in? Just curious. If I can't change it then I can't change it. And in a sense, that makes it easy / an easier solution.
This was always the case in C# and I believe in VB .Net. Were you using a Visual Basic pre .Net version where I believe it worked as you stated.
thanks