【发布时间】:2011-11-19 23:50:03
【问题描述】:
几个月来,使用 Async CTP 成功编译了以下内容:
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
突然之间,情况不再如此。 Visual Studio 似乎不再能够识别语法并用“预期语句结束”来标记函数。
最近,我的机器在打开 Visual Studio 的情况下一直开机(我感到很惭愧),它会自动关闭以安装一些 Winows 更新。从那时起,我一直无法编译解决方案。我在 2 周前查看了我的解决方案的备份副本,以确保我没有搞砸什么,并且我看到了同样的问题。
我也尝试卸载并重新安装 .Net Framework Async CTP。
据我所知,最近,我收到了几个 >net Framework 4 更新和安全更新。
我希望其他人能够对此有所了解,并为我节省在与 MS 电话上浪费的一天。
【问题讨论】:
-
异步的其他部分可以正常工作吗?
-
我能够编译和运行几个示例(例如,来自 Documents\Microsoft Visual Studio Async CTP\Samples(VB 101) Tutorial walkthrough 文件夹的 NetFlix 示例。)目前,我我使用 Async 只是为了在 VB 中获得 Iterator 和 Yield 功能。
-
如果其他异步示例正常工作,则表明编译器本身没问题......非常奇怪。
-
到目前为止我看到的示例没有演示迭代器或产量功能。有趣的是,它们确实可以编译。有趣的是,自从重新启动/更新以来,Visual Studio 编辑器现在对新函数的语法感到困惑。我不确定哪些文件负责编辑语法,所以我不确定从哪里开始研究。
标签: .net vb.net iterator async-ctp