My original answer was:

Code expression explicitly answering the question [MSDN link to details]

(This looks to me suspiciously like the valid answer described here. Of course I only found that "evidence" when editing this meta question.)

It was marked as a link-only answer and edited by the same editor to:

Try this: Code expression explicitly answering the question which is also linked to MSDN

I reverted, adding a comment, and he reverted my revert, so I have since edited it somewhat, and I deleted my comment, but I've added information from the link that barely further answers the question and does not explain why it is the right answer. In other words, if my original answer is a link-only answer, then it still is now, especially with the MSDN link not separate -- his addition.

Anyway the answer is here.

I probably should add a little bit of context that can only be otherwise gleened from looking at dates closely: The "accepted"* answer has been there for two years. I noted there was no VB-specific answer and the My namespace provided one so I added it this morning.

*I say "accepted" because the last comment from the OP, although they have accepted it, seems to suggest they didn't like it (though I think it is ok).


1 Answer 1


First, Cole was right to leave a comment asking you to improve the answer. In the past, the link-only answer hasn't been fully enforced. As a result, many of us with good intentions mistakenly learned from others that this is acceptable behavior. The problem with link-only answers is that links sometimes break, and leaving this on Stack Overflow is counter to the goals of providing answers that help future visitors for years to come.

Although Cole was trying to do the right thing and help you out, the first edit, adding "Try this", really didn't help anything at all. However, the final edit, which includes a summary, does help! If the link breaks, future visitors will have something tangible to use to acquire more information from a resource like Google.

Try this: My.Application.Info.DirectoryPath

This is using the My feature of VB.NET. This particular property is available for all non-web project types, since .NET Framework 2.0, including Console Apps as you require.

Your answer, in its current form, is no longer a link-only answer, but I feel like it's right on the edge. You could still improve it by adding a code example. In my experience, answers that cater to a wider audience tend to attract more upvotes, as the community, even people coming in from Google searches, will generally upvote content they find helpful. People coming from Google who are looking for answers will want to award those who helped them, and will generally ignore those who didn't.

Note how the accepted answer has some code in it. My suggestion is to model your answers after Nick's example for the best results. You could even take things a step further and make your answer even better, assuming you have a better example, and assuming you don't copy others. Hope this helps!

  • I sort of agree my original answer is still a link-only answer, but Cole's edit made it clearly so :-(
    – Mark Hurd
    Aug 23, 2012 at 11:07
  • FYI I have slightly updated my answer based upon this one.
    – Mark Hurd
    Aug 25, 2012 at 5:01
  • +1 from me @MarkHurd! Your answer looks pretty solid now! :)
    – jmort253
    Aug 25, 2012 at 6:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .