diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2010-01-08 13:27:49 -0800 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2010-01-08 13:27:49 -0800 |
commit | 623f8a1e53a1fd1bb58f540c226d1538dc5e86a5 (patch) | |
tree | a6eafa0a83060e2d70ae1c2db89f526758092df3 /src | |
parent | e65bdb1395ef1e7c0d9476bf48964f73d3de067f (diff) | |
download | DotNetOpenAuth-623f8a1e53a1fd1bb58f540c226d1538dc5e86a5.zip DotNetOpenAuth-623f8a1e53a1fd1bb58f540c226d1538dc5e86a5.tar.gz DotNetOpenAuth-623f8a1e53a1fd1bb58f540c226d1538dc5e86a5.tar.bz2 |
Fixed ASP.NET hosting to be flexible about where it is executed from.
Diffstat (limited to 'src')
-rw-r--r-- | src/DotNetOpenAuth.Test/TestBase.cs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/DotNetOpenAuth.Test/TestBase.cs b/src/DotNetOpenAuth.Test/TestBase.cs index 510e13a..ff96d1a 100644 --- a/src/DotNetOpenAuth.Test/TestBase.cs +++ b/src/DotNetOpenAuth.Test/TestBase.cs @@ -21,7 +21,17 @@ namespace DotNetOpenAuth.Test { /// <summary> /// The full path to the directory that contains the test ASP.NET site. /// </summary> - internal static readonly string TestWebDirectory = Path.GetFullPath(Path.Combine(Environment.CurrentDirectory, @"..\..\src\DotNetOpenAuth.TestWeb")); + internal string TestWebDirectory { + get { + // System.IO.Path.GetDirectoryName(new System.Uri(basePath).LocalPath) + string basePath = Path.GetDirectoryName(new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath); + string relativePath = @"src\DotNetOpenAuth.TestWeb"; + for (int i = 0; !Directory.Exists(Path.Combine(basePath, relativePath)) && i < 4; i++) { + relativePath = "..\\" + relativePath; + } + return Path.GetFullPath(relativePath); + } + } private MessageDescriptionCollection messageDescriptions = new MessageDescriptionCollection(); |