I have two projects in my solution and project A has a reference to project B. Project A calls a function in project B that should load a document that is within Project B:
return XDocument.Load(@"Mock\myDoc.html");
The problem is that XDocument.Load
is using the path from Project A (where there is no Mock\myDoc.html
).
I have tried using
string curDir = Directory.GetCurrentDirectory();
var path = String.Format("file:///{0}/Mock/myDoc.html", curDir);
but this as well gives me a path to ProjectA\Mock\myDoc.html
when instead it should be ProjectB\Mock\myDoc.html
. What am I missing?
EDIT: "Copy to Output" for the file "myDoc.html" is set to "Copy always" and the file is available in the Output folder of Project B.