Search

EditPoint.FindPattern causes InvalidCastException on SQL editor of VSTS for DB Professional projects by MVP CarlosQ

Closed
as Fixed Help for as Fixed

1
Sign in to vote
0
Sign in to vote
Sign in
to vote
Type: Bug
ID: 295427
Opened: 8/28/2007 3:55:59 AM
Access Restriction: Public
0
Workaround(s)
0
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.
Details (expand)
Product Language
English

Version

Visual Studio Code Name "Orcas" (Beta 2)
Operating System
Windows XP Professional
Operating System Language
English
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:

Sub PleaseMakeEnvDTEFirstClassCitizen

Dim objEditPoint As EditPoint

Try
objEditPoint = CType(DTE.ActiveDocument.Object, TextDocument).StartPoint.CreateEditPoint

objEditPoint.FindPattern("test", vsFindOptions.vsFindOptionsFromStart)

Catch ex As Exception
MsgBox(ex.ToString)
End Try
End Sub
Actual Results
You get an InvalidCastException on the line objEditPoint.FindPattern.

Obviously it is an internal exception because there is no cast on that line...
Expected Results
No exception.

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. [Details]

 

File Attachments
0 attachments
Sign in to post a comment.
Posted by Microsoft 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).

Thank you,
Visual Studio Product Team
Posted by Microsoft 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.

Thank you,
Visual Studio Product Team.
Posted by Microsoft 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.
Posted by MVP CarlosQ 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...