|
 |
|
|
First off, I'm running it in 2008, so maybe that's the cause of my issues, but here goes anyways:
When I try to Find in Entire Solution:
1) It seems to only search the files in the current project, not the entire solution
2) it opens up every single file in order to search it. This is very, very annoying, since if a project/solution has hundreds of files, it becomes very slow. The slowness is further magnified if one has the "Track active item in Solution Explorer" option enabled. Why not just search the filesystem instead of opening all the documents?
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Rob,
Thanks for the feedback. I don't think this is because of VS2008; I will look into both of those issues and post an update when I can. I have an idea about the cause of the first problem, and I think I should be able to follow your advice with the second one. I seem to remember that there was some reason I had to open every file, but I certainly shouldn't have to open the file in the IDE when in Find All mode.
Thanks again. Check back here in a few days, and I should have an update available.
Jeff
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Rob,
Just a progress update. While researching these issues, I have found some pretty serious problems with how I was determining which files to search depending on the selection in the "Look in" combo box. The good news is that I have improved the way this is being done, and the bad news is that I still have a little more to do before I will be ready to post an update.
Hang in there for a few more days (hopefully), and I will get something done as soon as I can.
Thanks again for your feedback.
Jeff
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
I just submitted an update that should fix the two issues you reported here, along with several others I found along the way. I have not tested this with VS2008, so please let me know if these or any other issues come up in that IDE.
Thank you.
Jeff
P.S. It might take a day or two before the article actually has the new source and binaries available for download.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
Your project should fill a big hole in Visual Studio - it's hard to understand why MS hasn't provided the same regular expressions for Visual Studio and the code it produces.
In any event, when I try to use it to find text with a very simple regular expression, I get the "Microsoft Visual Studio has encountered a problem..." error. I have successfully done one search but I haven't been able to repeat that. The error occurs right after I click Find Next. I have selected none of the options and the search pattern is a few lowercase alphabetic letters.
Let me know if you want any further information for trouble shooting.
Mike
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
mikebk,
You are the second person this week to have a problem with this add-in, and I would really like to figure out what is causing the errors. It would certainly help if you would be willing to download the source and set a breakpoint on the HandleFindNextButtonClick and then step through the code to see where the error is occurring. I understand if this is a little too much to ask, but I'm just not experiencing any problems like the ones you and Laoujin are describing. I have tested the add-in with XP SP3 and Vista Ultimate. Both machines have the VS2005 SP1 installed.
Thanks.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
I wasn't able to figure out how to start your project for debugging the addin. I kept getting the message about not starting a class library project.
What I did was to start a second vs then attached the first VS to the second for debugging. The first .sln file worked fine, the second blew up.
Here's the exception info:
System.IO.DirectoryNotFoundException was unhandled Message: Could not find a part of the path 'C:\ProphITCTI\Client\xyz\Handlers'.
There seem to be two issues: 1) It's looking for a directory that's not there (it might have been at one time). 2) It must need a try/catch around the place where it opens files 3) It should have an overall try/catch so an unhandled exception doesn't take VS down.
Mike
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
mikebk,
Thank you very much for the additional information; it certainly helps narrow it down a bit. I will take your advice and add some better handling of exceptions, and I will post an update. I am really buried in work today, so I might not get to it immediately, but I will try to have something up by the end of the week.
For the future, if you ever want to debug a project like this again, besides the directions in the "Using the Add-in" section and ReadMe.txt, you need to update the Debug page of the project properties:
Start external program: C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\devenv.exe
Command line arguments: /resetaddin RegexFindAndReplace.Connect
Working directory: C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\
I will update the article with this information when I post an update to the source and binaries.
Thanks again.
|
| Sign In·View Thread·PermaLink | 4.00/5 (1 vote) |
|
|
|
 |
|
|
Mike,
I submitted an update today, but, since Code Project edited the article, I had to do it through email, so I don't know how long it will be before it shows up here. I did find a few places that could be causing the error you are seeing, but I guess the only way to know if my modifications solve your problem is to try it out.
If you are still experiencing problems, I wonder if it wouldn't be too much to ask you to email me the project you are testing this with. Of course, you could replace the code in the source files with other text, in case the code is proprietary or something like that. I realize that this would be impossible if the project is really big or something, but I would like to make sure this is working.
Thank you for your help with this, and good luck.
Jeff
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
I've downloaded your update. It doesn't seem to change the problem.
I followed your debugging instructions and used Debug/Exceptions to catch the exception. It's at line 544 of Multiple FinderAndReplacer.cs: filenames.AddRange( Directory.GetFiles( Path.Combine( Path.GetDirectoryName( this.applicationObject.Solution.FileName ), projectItem.Name ) ) );
Here, this.applicationObject.Solution.FileName is C:\yyyCTI\Client\xxxx\xxxx yyy CTI.sln and projectItem.Name is Tcp
TCP turns out to be a folder inside a Visual Studio C# project and has a path C:\yyyCTI\Server\Transport\Tcp
It would seem that the addin isn't expecting to find a folder in a .csproj.
Mike
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
OK, Mike, I think we've got it now. I have modified the section of code you pointed out in MultipleFinderAndReplacer.cs, and I think it will be fine now. The offending code was operating under the assumption that any directory in a project would be a sub-directory of the solution, which is kind of stupid. The ProjectItem interface provides a way to get the actual path, so the update I just submitted should take care of it.
Thank you very much for taking the time to help me with this.
Jeff
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Jeff,
I forgot to point out that Visual Studio is still dying when the exception is taken. I think the problem is that the try block in HandleFindNextButtonClick() doesn't have a catch clause, only a finally clause.
Mike
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
Hey,
Your plugin sounded exactly what I needed so I downloaded it, dropped the two files in the AddIn directory and loaded the AddIn. I then needed to restart VS and got the following error:
"The Add-in 'Regex Find And Replace' failed to load or caused an exception. Would you like to remove this Add-in?
... Blah Blah...
Error Message: No such interface supported
Error number: 80004002"
A quick google search told me that someone else had the same problem with an Add-in which was fixed by uninstalling SP1 (huh).
We're on a tight deadline here so I couldn't spend any more time on finding the exact issue. (Which means we're going to change all the stuff manually, yaye!)
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Laoujin,
I'm sorry to hear that it isn't working for you. I wish the error message gave me a better idea of what the problem is! I would hate to have you make your changes by hand, so let me suggest that you take a look at this add-in as well:
http://channel9.msdn.com/playground/Sandbox/176542/[^]
It doesn't provide all the features that my add-in does, but it may provide the most important feature: loading successfully.
In the mean time, what kind of changes are you trying to make? I would be happy to help if I can.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
 |
|
|
I'm really sorry, Uwe, but I haven't gotten around to installing VS2008, so I don't know the answer to your question. Installing it has been on my TODO list for a while, but we don't plan on migrating to it for a while at work, so it hasn't been given the highest priority. Maybe someone else will come along and try it out.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
I just tried it - if you change the version number from 8.0 to 9.0 in the .addin file, then it will install fine. But clicking "Find Next" in the search window from this addin unfortunately crashes VS.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Well, thanks for trying it out. Does it crash every time, or is there anything else you need to do to get it to crash? What settings do you have for the search? "Current Document", "Current Project", "Find in Files", etc. I will try to look into it when I get a chance, but it might a little while before I can install VS2008.
|
| Sign In·View Thread·PermaLink | 5.00/5 (1 vote) |
|
|
|
 |
|
|
I didn't try out all combinations under which the addin crashes, but it crashes DEFINATELY
a) when using "Current Solution" b) when using [x] ECMA Script and [x] Ignore Pattern Whitespace in "Current Document"
regardless of the regex entered (even with empty regex)
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
Curious. I went ahead and installed Visual Studio Team System 2008 (trial) yesterday, and I didn't experience any problems with this add-in at all. I tried all of the different modes and all of the different options for the document(s) to search. No crash. I would suggest that you download the source and build it, so you can see where the crash is occurring when you run it on your machine. If you come up with anything, please let me know, in case there is something I need to look at.
Sorry that I wasn't able to be of more help with this one.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Visual Studio's odd regular expression syntax has bugged me for years, but I've never quite got around to implementing an addin like this, let alone writing an article. This'll be getting some use over the next few weeks!
|
| Sign In·View Thread·PermaLink | 5.00/5 (1 vote) |
|
|
|
 |