diff --git a/src/AddIns/Misc/CodeAnalysis/Src/FxCopWrapper.cs b/src/AddIns/Misc/CodeAnalysis/Src/FxCopWrapper.cs index 25d1903e3a..44e27a73dc 100644 --- a/src/AddIns/Misc/CodeAnalysis/Src/FxCopWrapper.cs +++ b/src/AddIns/Misc/CodeAnalysis/Src/FxCopWrapper.cs @@ -88,6 +88,23 @@ namespace ICSharpCode.CodeAnalysis string fxCopPath = AnalysisIdeOptionsPanel.FxCopPath; if (string.IsNullOrEmpty(fxCopPath)) { // Code duplication: FxCop.cs in ICSharpCode.Build.Tasks + using (RegistryKey key = Registry.LocalMachine.OpenSubKey(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\Setup\EDev")) { + if (key != null) { + fxCopPath = key.GetValue("FxCopDir") as string; + } + } + if (IsFxCopPath(fxCopPath)) { + return fxCopPath; + } + using (RegistryKey key = Registry.LocalMachine.OpenSubKey(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\Setup\EDev")) { + if (key != null) { + fxCopPath = key.GetValue("FxCopDir") as string; + } + } + if (IsFxCopPath(fxCopPath)) { + return fxCopPath; + } + fxCopPath = FromRegistry(Registry.CurrentUser.OpenSubKey(@"Software\Classes\FxCopProject\Shell\Open\Command")); if (IsFxCopPath(fxCopPath)) { return fxCopPath; @@ -96,6 +113,7 @@ namespace ICSharpCode.CodeAnalysis if (IsFxCopPath(fxCopPath)) { return fxCopPath; } + return null; } else { if (IsFxCopPath(fxCopPath)) { return fxCopPath; diff --git a/src/Libraries/ICSharpCode.Build.Tasks/Project/FxCop.cs b/src/Libraries/ICSharpCode.Build.Tasks/Project/FxCop.cs index 60ec6b2110..acb7ed64a5 100644 --- a/src/Libraries/ICSharpCode.Build.Tasks/Project/FxCop.cs +++ b/src/Libraries/ICSharpCode.Build.Tasks/Project/FxCop.cs @@ -163,12 +163,30 @@ namespace ICSharpCode.Build.Tasks string FindFxCopPath() { // Code duplication: FxCopWrapper.cs in CodeAnalysis addin - string fxCopPath = FromRegistry(Registry.CurrentUser.OpenSubKey(@"Software\Classes\FxCopProject\Shell\Open\Command")); - if (fxCopPath.Length > 0 && File.Exists(Path.Combine(fxCopPath, ToolName))) { + string fxCopPath = null; + using (RegistryKey key = Registry.LocalMachine.OpenSubKey(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\Setup\EDev")) { + if (key != null) { + fxCopPath = key.GetValue("FxCopDir") as string; + } + } + if (!string.IsNullOrEmpty(fxCopPath) && File.Exists(Path.Combine(fxCopPath, ToolName))) { + return fxCopPath; + } + using (RegistryKey key = Registry.LocalMachine.OpenSubKey(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\Setup\EDev")) { + if (key != null) { + fxCopPath = key.GetValue("FxCopDir") as string; + } + } + if (!string.IsNullOrEmpty(fxCopPath) && File.Exists(Path.Combine(fxCopPath, ToolName))) { + return fxCopPath; + } + + fxCopPath = FromRegistry(Registry.CurrentUser.OpenSubKey(@"Software\Classes\FxCopProject\Shell\Open\Command")); + if (!string.IsNullOrEmpty(fxCopPath) && File.Exists(Path.Combine(fxCopPath, ToolName))) { return fxCopPath; } fxCopPath = FromRegistry(Registry.ClassesRoot.OpenSubKey(@"FxCopProject\Shell\Open\Command")); - if (fxCopPath.Length > 0 && File.Exists(Path.Combine(fxCopPath, ToolName))) { + if (!string.IsNullOrEmpty(fxCopPath) && File.Exists(Path.Combine(fxCopPath, ToolName))) { return fxCopPath; } return null; diff --git a/src/Libraries/ICSharpCode.Build.Tasks/Project/SharpDevelop.CodeAnalysis.targets b/src/Libraries/ICSharpCode.Build.Tasks/Project/SharpDevelop.CodeAnalysis.targets index f3ea8d2cac..0850f89282 100644 --- a/src/Libraries/ICSharpCode.Build.Tasks/Project/SharpDevelop.CodeAnalysis.targets +++ b/src/Libraries/ICSharpCode.Build.Tasks/Project/SharpDevelop.CodeAnalysis.targets @@ -23,6 +23,10 @@ $(PrepareForRunDependsOn);SharpDevelopFxCopRun + + + + 0) { + Debug.WriteLine("WorkerManager: shutting down free worker"); DequeueFreeWorkerProcess().Shutdown(); } else { ClearLastBuildDoneTimer(); @@ -126,6 +127,7 @@ namespace ICSharpCode.SharpDevelop.BuildWorker public void RaiseError(string message) { + Debug.WriteLine(message); RaiseEvent(new BuildErrorEventArgs(null, null, null, -1, -1, -1, -1, message, null, "SharpDevelopBuildWorkerManager")); }