Suddenly VB.Net Iterator Function Wont Compile?


  • I hope this is the correct forum. I landed here from the Async CTP page and didn't see anything specific to the CTP in the forums list.

    For months now, using the Async CTP Ithe following compiled successfully:


        Public Shared Iterator Function FindVisualChildren(Of T As DependencyObject)(ByVal depObj As DependencyObject) As IEnumerable(Of T)
            If depObj IsNot Nothing Then
                For i As Integer = 0 To VisualTreeHelper.GetChildrenCount(depObj) - 1
                    Dim child As DependencyObject = VisualTreeHelper.GetChild(depObj, i)
                    If child IsNot Nothing AndAlso TypeOf child Is T Then
                        Yield CType(child, T)
                    End If
                    For Each childOfChild As T In FindVisualChildren(Of T)(child)
                        Yield childOfChild
                    Next childOfChild
                Next i
            End If
        End Function


    Suddenly, this is no longer the case. Visual Studio no longer appears to recognise the syntax and squiggles Function with 'End of Statement Expected'.

    Recently, my machine was left on (shame on me) with Visual Studio open and it was shutdown automatically to install some Winows Updates. SInce then, I have been unable to compile the solution. I went to a backup copy of my solution as of 2 weeks ago just to make sure I didn't goof something up and I'm seeing the same issue.

    I tried uninstalling and re-installing the .Net Framework Async CTP as well.

    From what I can tell, recently, I received several >net Framework 4 Updates and Security Updates for the framework.

    I'm hoping that someone may be able to shed some light on this and save me a wasted day on the phone with support.

    • แก้ไขโดย Berney 19 กันยายน 2554 6:31
    19 กันยายน 2554 6:25