I am unable to run myCustom command created using VSIX in Visual Studio 2022 command window.It says "Command" not valid .Same code works in 2019

2023-07-23T15:54:00.9866667+00:00

I created a command under tools using vsExtensions

samplecode

            var menuCommandID = new CommandID(CommandSet, CommandId);
            var menuItem = new OleMenuCommand(this.Execute, menuCommandID);
            menuItem.ParametersDescription = "$";
            commandService.AddCommand(menuItem);
vsct file is 
      <Button guid="guidDynamicMenuPackageCmdSet" id="Command1Id" priority="0x0100" type="Button">
        <Parent guid="guidDynamicMenuPackageCmdSet" id="MyMenuGroup" />
        <Icon guid="guidImages" id="bmpPic1" />
        <CommandFlag>AllowParams</CommandFlag>
        <Strings>
          <CommandName>CN1</CommandName>
          <ButtonText>Invoke Command1</ButtonText>
          <CanonicalName>CN1</CanonicalName>
          <LocCanonicalName>.Tools.CN1</LocCanonicalName>
        </Strings>
When the run the command on the **CommandWindow **by giving 
.Tools.CN1 "ABC" it says "Tools.CN1" is not valid 
Any other combination is also giving the same error. 

Any help is  appreciated
Visual Studio Extensions
Visual Studio Extensions
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Extensions: A program or program module that adds functionality to or extends the effectiveness of a program.
192 questions
{count} votes