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. 4
      src/AddIns/Misc/CodeAnalysis/Src/FxCopWrapper.cs
  2. 17
      src/Libraries/ICSharpCode.Build.Tasks/Project/FxCop.cs

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

@ -105,6 +105,10 @@ namespace ICSharpCode.CodeAnalysis @@ -105,6 +105,10 @@ namespace ICSharpCode.CodeAnalysis
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"));
if (IsFxCopPath(fxCopPath)) {
return fxCopPath;

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

@ -169,7 +169,7 @@ namespace ICSharpCode.Build.Tasks @@ -169,7 +169,7 @@ namespace ICSharpCode.Build.Tasks
fxCopPath = key.GetValue("FxCopDir") as string;
}
}
if (!string.IsNullOrEmpty(fxCopPath) && File.Exists(Path.Combine(fxCopPath, ToolName))) {
if (IsFxCopPath(fxCopPath)) {
return fxCopPath;
}
using (RegistryKey key = Registry.LocalMachine.OpenSubKey(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\Setup\EDev")) {
@ -177,21 +177,30 @@ namespace ICSharpCode.Build.Tasks @@ -177,21 +177,30 @@ namespace ICSharpCode.Build.Tasks
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;
}
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;
}
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 null;
}
bool IsFxCopPath(string fxCopPath)
{
return !string.IsNullOrEmpty(fxCopPath) && File.Exists(Path.Combine(fxCopPath, ToolName));
}
string FromRegistry(RegistryKey key)
{
// Code duplication: FxCopWrapper.cs in CodeAnalysis addin

Loading…
Cancel
Save