About 10 minutes I needed to understand the problem. Luckily I had tests. It appears, that Path.Combine works funny. Here are a comple of examples:
- If you do Path.Combine("../Tests/", "/123.xml") the result will be "/123.xml"
- If you do Path.Combine("../Tests/", "123.xml") the result will be "../Tests/123.xml"
- Finally, if you do Path.Combine("../Tests", "123.xml") the result will be "../Tests\123.xml"
Oh, frankly speaking, I would really like to have Path.Combine("../Tests/", "/123.xml") give me "../Tests/123.xml" or, at least, "../Tests//123.xml" and even "../Tests\123.xml" would be fine.
For now, I have to remember funny point #1 and will try to do #2 and #3 all along.
No comments:
Post a Comment