Skip to content

Commit 98d275b

Browse files
committed
Register CodeExplorerCommands from the correct assembly
Thanks to MDoerner for finding the bug, fixes #3842
1 parent 91f0a31 commit 98d275b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Rubberduck.Main/Root/RubberduckIoCInstaller.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,8 @@ private Type[] ToolsMenuItems()
520520

521521
private static void RegisterCodeExplorerViewModelWithCodeExplorerCommands(IWindsorContainer container)
522522
{
523-
var codeExplorerCommands = Assembly.GetExecutingAssembly().GetTypes()
523+
// Assumption: All Commands are defined in the same assembly as CommandBase
524+
var codeExplorerCommands = Assembly.GetAssembly(typeof(CommandBase)).GetTypes()
524525
.Where(type => type.IsClass && type.Namespace != null &&
525526
type.CustomAttributes.Any(a => a.AttributeType == typeof(CodeExplorerCommandAttribute)));
526527
container.Register(Component.For<CodeExplorerViewModel>()

0 commit comments

Comments
 (0)