Path of Solution

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
Is there a property to find the path of the solution, I've found a few
properties that give you the executable path i.e. Application.StartupPath
etc. and I know i could just parse this to remove the binand get what i am
looking for but I thought there might have been some property to get the path
of the solution directly. Anybody have any ideas.
Any help would be great
 
vbdotnetmania said:
Is there a property to find the path of the solution, I've found a few
properties that give you the executable path i.e. Application.StartupPath
etc. and I know i could just parse this to remove the binand get what i am
looking for but I thought there might have been some property to get the
path
of the solution directly. Anybody have any ideas.

This is not supported for applications, because in general the solution
(source code) is not distributed with the application.
 
VBDotmania,

When Application.StartupPath does not directly give the path of the
application, what does it than give for you?

Cor
 
Hi Cor,
I'm pretty sure what you are getting at is that
Application.StartupPath gives you the path of the exe e.g. SolutionName\bin,
so obviously it is quite easy to get the solutionname from this using
something like
Result = Strings.Left(Result, Len(Result) - 4)
or some other equivalent. I was simply curious to know if there was some
property to get the solution path directly, given the replies I take it that
there is not.
Thanks for your replies.
Barry.
 
VBdotnetmania,

Now I see what you mean. It gives you back the startup path. When you are in
developing mode, than your startup exe is in that bin folder you mention,
however in real runtime it will probably be in \program
files\YourCompanynameOrWhatever\

Cor
 
The reason that I wanted the actual solution path was due to a program that I
have made and use quite a lot but I am regularly updating so it's more
convenient at present to run the app from visual studio.

It has an app.config file that I need to update with any new settings in the
solutions folder when i close my application hence I need the path for the
app.config file and not just for the solution.exe.config file which is all I
would need if i were to be running the exe directly.

Anyway it's the 1st time I've started to use the app.config file and maybe
my approach is wrong, in fact I'd be surprised if it wasn't, any ideas on
this would be good.
Thanks,
Barry.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top