Browse Source

Fixed SD2-643: Project content registry does not find references using relative paths

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@1761 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 19 years ago
parent
commit
8a61777e5d
  1. 29
      src/Main/Base/Project/Src/Project/Items/ReferenceProjectItem.cs

29
src/Main/Base/Project/Src/Project/Items/ReferenceProjectItem.cs

@ -121,20 +121,23 @@ namespace ICSharpCode.SharpDevelop.Project @@ -121,20 +121,23 @@ namespace ICSharpCode.SharpDevelop.Project
public override string FileName {
get {
if (Project != null) {
string projectDir = Project.Directory;
string hintPath = HintPath;
if (hintPath != null && hintPath.Length > 0) {
return Path.Combine(Project.Directory, hintPath);
}
string name = Path.Combine(Project.Directory, Include);
if (File.Exists(name)) {
return name;
}
if (File.Exists(name + ".dll")) {
return name + ".dll";
}
if (File.Exists(name + ".exe")) {
return name + ".exe";
}
try {
if (hintPath != null && hintPath.Length > 0) {
return Path.GetFullPath(Path.Combine(projectDir, hintPath));
}
string name = Path.GetFullPath(Path.Combine(projectDir, Include));
if (File.Exists(name)) {
return name;
}
if (File.Exists(name + ".dll")) {
return name + ".dll";
}
if (File.Exists(name + ".exe")) {
return name + ".exe";
}
} catch {} // ignore errors when path is invalid
}
return Include;
}

Loading…
Cancel
Save