Loading ...
Sorry, an error occurred while loading the content.

CodeClass2 vs. Removing CodeElements

Expand Messages
  • elektrofetish
    I ve run into two issues that I d like to get some feedback on from the community here. Firstly, calling CodeClass2.RemoveInterface() throws the following
    Message 1 of 1 , May 5, 2007
    • 0 Attachment
      I've run into two issues that I'd like to get some feedback on from
      the community here.

      Firstly, calling CodeClass2.RemoveInterface() throws the following
      error when attempting to remove an interface that is a generic:

      {"Value does not fall within the expected range."}
      [System.ArgumentException]: {"Value does not fall within the
      expected range."}
      Data: {System.Collections.ListDictionaryInternal}
      HelpLink: null
      InnerException: null
      Message: "Value does not fall within the expected range."
      Source: "EnvDTE80"
      StackTrace: " at EnvDTE80.CodeClass2.RemoveInterface(Object
      Element)\r\n at
      Analysis.VisualStudio.CodeClass2Proxy.RemoveInterface
      (CodeInterface2Proxy codeInterface) in
      C:\\Users\\jgall\\Documents\\Visual Studio 2005
      \\Projects\\Cartographer
      Solution\\Analysis.VisualStudio\\CodeClass2Proxy.cs:line 305"
      TargetSite: {Void RemoveInterface(System.Object)}

      In this case I was trying to remove the interface System.IEquatable
      (Of Whatever) from a vb.net class file. I get the same error /
      behavior when attempting the same operation in C# as well.

      Secondly, using CodeClass2.RemoveVariable, .RemoveMethod (etc) works
      perfectly fine. Unfortunately if your element has a doc comment
      calling these methods results in the method being removed (which is
      good) but the doc comment being left in your code if your programming
      language is vb.net (C# code doc comments are in fact removed when
      calling this method). Does anyone have any feedback on this or a
      decent methodology for removing the doc comments from vb.net files
      when the associated code element is removed?

      Thanks for any feedback you have.

      Best,

      Joshua
    Your message has been successfully submitted and would be delivered to recipients shortly.