Visual Studio and .NET Framework Home
EditPoint.FindPattern causes InvalidCastException on SQL editor of VSTS for DB Professional projects
Carlos J. Quintero
8/28/2007 3:55:59 AM
User(s) can reproduce this bug
When you execute a macro calling EnvDTE.EditPoint.FindPattern on a document of a TSQL editor of a SQL Server Database Project you get InvalidCastException.
Visual Studio Code Name "Orcas" (Beta 2)
Windows XP Professional
Operating System Language
Steps to Reproduce
- Open VS 2008 Beta2 and click the File, New Project menu
- Select "Database Projects" type and then the "SQL Server 2005" project template.
- In the Scripts folder of the Solution Explorer, open some .sql file to make it the active window
- Create a macro like this:
Dim objEditPoint As EditPoint
objEditPoint = CType(DTE.ActiveDocument.Object, TextDocument).StartPoint.CreateEditPoint
Catch ex As Exception
You get an InvalidCastException on the line objEditPoint.FindPattern.
Obviously it is an internal exception because there is no cast on that line...
I am aware that it is a T-SQL editor different from the editor of a code window, but the Find feature of VS (which uses the VS SDK or some low level stuff) works fine on that file, so it can be only that EnvDTE is not very well supported. Could you please fix it? It hurts add-ins and 3rd party tools that use EnvDTE for the extensibility of Visual Studio...
TAP Code (if applicable)
You can indicate your satisfaction with how Microsoft handled this issue by completing this quick
3 question survey
to post a comment.
Please enter a comment.
Carlos J. Quintero
on 9/5/2007 at 5:43 AM
Could you fix it, please? That bug did not happen in VS 2005 so there is something wrong that you added to VS 2008...
on 8/30/2007 at 9:19 AM
Thanks for the additional scenario info, Carlos. I've added this to the items that we'll be discussing in the next several days as we determine the breadth of our DTE story.
on 8/28/2007 at 7:15 PM
Thanks for your feedback. We have reproduced this bug on Visual Studio 2008 Beta 2, and we are sending this bug to the appropriate group within the VisualStudio Product Team for triage and resolution.
Visual Studio Product Team.
on 8/28/2007 at 5:53 PM
Thank you for your feedback. We are currently investigating. If this issue is urgent, please call support directly (see http://support.microsoft.com).
Visual Studio Product Team
to post a workaround.
Please enter a workaround.
© 2014 Microsoft