Hi,
I am trying to create unittests that can be shared amongst my development team so I need to have all paths in the project be relative.
Where this is giving me trouble is with the HttpWebRequest class. I want it to serve static testdata from a file in the local filesystem.
I'd like to do something like this:
file:///./TestData/test.html
But that just produces C:\TestData\test.html and a DirectoryNotFoundException.
The code for the HttpWebRequest looks like this:
var request = HttpWebRequest.Create(uri);
var response = request.GetResponse();
var responseStream = new StreamReader(response.GetResponseStream());
return responseStream.ReadToEnd();
How can I convince C# to resolve a relative path without breaking the Uri syntax?
greetings Daniel