I need to replace about 2000 strings with another string, i tried writting a VS Add-In to iterate through a list of strings and to replace one by one in all files, somthing like this:
foreah(item in strings)
{
findWin.FindWhat = item;
findWin.ReplaceWith = "string2";
findWin.Action = vsFindAction.vsFindActionReplaceAll;
findWin.Target = vsFindTarget.vsFindTargetFiles;
findWin.KeepModifiedDocumentsOpen = true;
findWin.WaitForFindToComplete = true;
findWin.Execute();
}
However, it only works if i set the find options to OpenDocuments, otherwise it throws an AccessViolation exception. There are about 8 projects in the solution and a lot files in there.
Is there any clean/better way to achieve that?
Thank you