So I have a solution witch has two different projects(for example one of them is admin and one of them is presentation). it means I have two .exe files. My current project is for example presentation but I want the directory of the other one(admin)
AppDomain.CurrentDomain.BaseDirectory
this code gives me the current project directory. one way is to back(./) and reach to the other project but it will be too much hard code. Is there any better ways to do it
>Solution :
Generally solutions/projects are design time concepts, at run time these are simply independent exes that you can put wherever you want (like I assume u will be putting it in say c:\xxx\Admin\Project1.exe and c:\xxx\Presentation\Project2.exe). If so there are many possible ways to access these during runtime, some include:
- Relative path: like you mentioned using ..\ syntax
- Some form of config: app.config/other config file (local directory or appdata etc)/registry
- Advanced modes: maybe IPC (works if both exe’s are running)