Solution path in C#

  • Thread starter Thread starter Kondapanaidu
  • Start date Start date
K

Kondapanaidu

Hi,

I am using C#.NET1.1

My solution is having different projects

How will I know My solution path like(Application.startupPath) this is
for Individual projects this will gives upto their corresponding EXEs.

But I need the path like Only the Main solution.

Thanks for giving the great Inputs
 
Once compiled, there is no concept of solutions, so you can't get this at
runtime.

At build time in VS, however, you can (in pre-build / post-build events) use
the macros $(SolutionFileName), $(SolutionPath), $(SolutionDir) and
$(SolutionName).

I've never tried them, however; I always think of projects (mapping to
assemblies) as the key item, not solutions.

Perhaps if you could indicate what you are trying to achieve there might be
a better answer?

Marc
 
Hi,

I'm not very sure what you are asking, is your problem at runtime or at
compile time?
 
Kondapanaidu,

Solutions exists only at compile time. When you build your application and
deploy it on the target machine there is not a trace of any solutions or
project files. Working folder and target folder (after deploying) as well as
the file structure of your solution and the final product in most of the
cases are different.

Further more it is good practice to limit your application to access only
the files, which are placed below the application's root folder + isolated
storage and the temp folder.
 

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