I have two projects in my solution, ProjectA and ProjectB. ProjectA contains folder named 'Config' which contains myfile.xml
.
I want to access this file from ProjectB which is a WebAPI
.
I tried following code:
string rootPath = System.Web.Hosting.HostingEnvironment.MapPath("~\\Config\\myfile.xml");
But It couoldn't retrieve ProjectA instead it made the following Path:
D:\Projects\DGS.DGSAPI.UI\ProjectB\Config\AffiliateInformationCollection.xml
instead of
D:\Projects\DGS.DGSAPI.UI\ProjectA\Config\AffiliateInformationCollection.xml
What am I doing wrong?