7

Using Visual Studio (2010) is there any way to combine Find All References with a Replace All capability.

I have inherited VB.NET code written by a VB6 programmer and I want to remove all the references to IIF and many other VB6 functions as they are causing several problems.

Does either CodeRush or Resharper support this feature? I couldn't seem to find any documentation on either about it if they do.

Some of the functions I can remove by normal find and replace but others are more difficult to build the regex for.

I have tried to remove the reference to the Microsoft.VisualBasic.dll but the number of errors is very considerable (the code was just copy-pasted for every new class that was created)

Seph
  • 8,472
  • 10
  • 63
  • 94
  • Right-click the identifier in the text editor and select Rename. – Hans Passant Oct 30 '11 at 12:43
  • You could refactor it seph then rename – Allan Chua Oct 30 '11 at 13:06
  • using which IDE extension? the stock VS2010 IDE doesn't have a Rename capability for function calls, only Rename for function definitions (And since these calls are defined in an external dll, I can't do this sadly). Even if I removed the dll reference and redefine the function locally and then Rename the function itself I cannot rename a function to `If` as it's a reserved word. – Seph Oct 30 '11 at 13:18
  • 1
    MZ-Tools for VB6 has similar functionality, it's likely that the VB.NET version will too (although I've not used the VB.NET version). however I'm very worried that you want to simply 'remove' all instances of IIF. There's probably vital code in there that needs to be refactored by hand. – Robin Sep 24 '13 at 09:26
  • If the functions names, follow a good naming pattern, and will not interfere with other names (like variable names or something), then you could do a find-in-files-and-replace with Notepad++ . I have had good success sometimes in using a non-IDE text editor for VB files, really. – Whirl Mind Oct 16 '15 at 13:20

0 Answers0