I have 2 projects Project A, Project B, project A has a link to project B, project A is executable.
Project A --> Project B
inside project B there is a directory called "MyFolder"
therefore, the soulotion hierarchy is as follows:
MySolution - A - B - MyFolder
how do I get the relative path to MyFolder using in project A (Executable).
I found an answer that states the following:
sring path = Assembly.GetAssembly(typeof(SomeClassInBProject)).Location;
The path I returned to is the path to B.dll in bin \ debug, how can I get the path in this dll.
Edit:
iv'e also tried:
Assembly assembly = Assembly.GetAssembly(typeof(SomeClassInBProject)); FileStream fs = assembly.GetFile(@"MyFolder\myFile"); and FileStream fs = assembly.GetFile("MyFolder\myFile"); and FileStream fs = assembly.GetFile("myFile");
fs i am always null.
source share