Browse Source

Path to FxCop 1.36 now detected.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/3.0@3703 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Matt Ward 17 years ago
parent
commit
11575009d5
  1. 6
      src/AddIns/Misc/CodeAnalysis/Src/FxCopWrapper.cs
  2. 19
      src/Libraries/ICSharpCode.Build.Tasks/Project/FxCop.cs

6
src/AddIns/Misc/CodeAnalysis/Src/FxCopWrapper.cs

@ -104,7 +104,11 @@ namespace ICSharpCode.CodeAnalysis
if (IsFxCopPath(fxCopPath)) { if (IsFxCopPath(fxCopPath)) {
return fxCopPath; return fxCopPath;
} }
fxCopPath = FromRegistry(Registry.ClassesRoot.OpenSubKey(@"FxCop.Project.9.0\Shell\Open\Command"));
if (IsFxCopPath(fxCopPath)) {
return fxCopPath;
}
fxCopPath = FromRegistry(Registry.CurrentUser.OpenSubKey(@"Software\Classes\FxCopProject\Shell\Open\Command")); fxCopPath = FromRegistry(Registry.CurrentUser.OpenSubKey(@"Software\Classes\FxCopProject\Shell\Open\Command"));
if (IsFxCopPath(fxCopPath)) { if (IsFxCopPath(fxCopPath)) {
return fxCopPath; return fxCopPath;

19
src/Libraries/ICSharpCode.Build.Tasks/Project/FxCop.cs

@ -169,7 +169,7 @@ namespace ICSharpCode.Build.Tasks
fxCopPath = key.GetValue("FxCopDir") as string; fxCopPath = key.GetValue("FxCopDir") as string;
} }
} }
if (!string.IsNullOrEmpty(fxCopPath) && File.Exists(Path.Combine(fxCopPath, ToolName))) { if (IsFxCopPath(fxCopPath)) {
return fxCopPath; return fxCopPath;
} }
using (RegistryKey key = Registry.LocalMachine.OpenSubKey(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\Setup\EDev")) { using (RegistryKey key = Registry.LocalMachine.OpenSubKey(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\Setup\EDev")) {
@ -177,21 +177,30 @@ namespace ICSharpCode.Build.Tasks
fxCopPath = key.GetValue("FxCopDir") as string; fxCopPath = key.GetValue("FxCopDir") as string;
} }
} }
if (!string.IsNullOrEmpty(fxCopPath) && File.Exists(Path.Combine(fxCopPath, ToolName))) { if (IsFxCopPath(fxCopPath)) {
return fxCopPath;
}
fxCopPath = FromRegistry(Registry.ClassesRoot.OpenSubKey(@"FxCop.Project.9.0\Shell\Open\Command"));
if (IsFxCopPath(fxCopPath)) {
return fxCopPath; return fxCopPath;
} }
fxCopPath = FromRegistry(Registry.CurrentUser.OpenSubKey(@"Software\Classes\FxCopProject\Shell\Open\Command")); fxCopPath = FromRegistry(Registry.CurrentUser.OpenSubKey(@"Software\Classes\FxCopProject\Shell\Open\Command"));
if (!string.IsNullOrEmpty(fxCopPath) && File.Exists(Path.Combine(fxCopPath, ToolName))) { if (IsFxCopPath(fxCopPath)) {
return fxCopPath; return fxCopPath;
} }
fxCopPath = FromRegistry(Registry.ClassesRoot.OpenSubKey(@"FxCopProject\Shell\Open\Command")); fxCopPath = FromRegistry(Registry.ClassesRoot.OpenSubKey(@"FxCopProject\Shell\Open\Command"));
if (!string.IsNullOrEmpty(fxCopPath) && File.Exists(Path.Combine(fxCopPath, ToolName))) { if (IsFxCopPath(fxCopPath)) {
return fxCopPath; return fxCopPath;
} }
return null; return null;
} }
bool IsFxCopPath(string fxCopPath)
{
return !string.IsNullOrEmpty(fxCopPath) && File.Exists(Path.Combine(fxCopPath, ToolName));
}
string FromRegistry(RegistryKey key) string FromRegistry(RegistryKey key)
{ {
// Code duplication: FxCopWrapper.cs in CodeAnalysis addin // Code duplication: FxCopWrapper.cs in CodeAnalysis addin

Loading…
Cancel
Save