B
Berryl Hesh
I don't know where the "%" sysmbols are coming from, but without them this
is a valid directory. I've pasted both the exception and code that
triggeered it below. The purpose of this code block is to gather a list of
dll's.
Thanks - BH
Here is the Code
/-------------------------------/
private static string[] GetAssemblyPaths() {
var uri = new Uri(Assembly.GetExecutingAssembly().CodeBase);
var directory = uri.IsAbsoluteUri ?
Path.GetDirectoryName(uri.AbsolutePath) : Directory.GetCurrentDirectory();
return Directory.GetFiles(directory, "*.DLL",
SearchOption.AllDirectories);
}
Here is the Exception
/-------------------------------/
System.IO.DirectoryNotFoundException was unhandled
Message="Could not find a part of the path
'C:\\Documents%20and%20Settings\\Eric\\My%20Documents\\Visual%20Studio%202008\\Projects\\Learning\\ActiveRecord\\src\\ActiveRecord.WinTest\\bin\\Debug'."
Source="mscorlib"
StackTrace:
at System.IO.__Error.WinIOError(Int32 errorCode, String
maybeFullPath)
at System.IO.Directory.InternalGetFileDirectoryNames(String path,
String userPathOriginal, String searchPattern, Boolean includeFiles, Boolean
includeDirs, SearchOption searchOption)
at System.IO.Directory.GetFiles(String path, String searchPattern,
SearchOption searchOption)
InnerException:
is a valid directory. I've pasted both the exception and code that
triggeered it below. The purpose of this code block is to gather a list of
dll's.
Thanks - BH
Here is the Code
/-------------------------------/
private static string[] GetAssemblyPaths() {
var uri = new Uri(Assembly.GetExecutingAssembly().CodeBase);
var directory = uri.IsAbsoluteUri ?
Path.GetDirectoryName(uri.AbsolutePath) : Directory.GetCurrentDirectory();
return Directory.GetFiles(directory, "*.DLL",
SearchOption.AllDirectories);
}
Here is the Exception
/-------------------------------/
System.IO.DirectoryNotFoundException was unhandled
Message="Could not find a part of the path
'C:\\Documents%20and%20Settings\\Eric\\My%20Documents\\Visual%20Studio%202008\\Projects\\Learning\\ActiveRecord\\src\\ActiveRecord.WinTest\\bin\\Debug'."
Source="mscorlib"
StackTrace:
at System.IO.__Error.WinIOError(Int32 errorCode, String
maybeFullPath)
at System.IO.Directory.InternalGetFileDirectoryNames(String path,
String userPathOriginal, String searchPattern, Boolean includeFiles, Boolean
includeDirs, SearchOption searchOption)
at System.IO.Directory.GetFiles(String path, String searchPattern,
SearchOption searchOption)
InnerException: