Async throw error: "End of statement expected"
Async throw error: "End of statement expected"
我正在使用 VSTO VB 编写 outlook 插件,并希望创建一个异步子程序。
这是以下代码:
Public Async Sub TestAsync()
Msgbox("test")
End Sub
但是在异步之后,编译器说:"End of statement expected"。
我也试过做一个函数,但没有成功(同样的错误):
Public Async Function TestAsync() As Task
Msgbox("test")
End Function
异步声明缺少什么?
已将 Async
关键字添加到 VB.NET version 11.0, which was released along side Visual Studio 2012 and .NET Framework 4.5. The first version of Visual Studio Tools for Office which supported .NET 4.5 was VSTO version 4.5. It was included in the Office Developer Tools for Visual Studio 2012。
我正在使用 VSTO VB 编写 outlook 插件,并希望创建一个异步子程序。 这是以下代码:
Public Async Sub TestAsync()
Msgbox("test")
End Sub
但是在异步之后,编译器说:"End of statement expected"。
我也试过做一个函数,但没有成功(同样的错误):
Public Async Function TestAsync() As Task
Msgbox("test")
End Function
异步声明缺少什么?
已将 Async
关键字添加到 VB.NET version 11.0, which was released along side Visual Studio 2012 and .NET Framework 4.5. The first version of Visual Studio Tools for Office which supported .NET 4.5 was VSTO version 4.5. It was included in the Office Developer Tools for Visual Studio 2012。