Skip to content

[DevComm] Example doesn't compile #50695

@gewarren

Description

@gewarren

Type of issue

Code doesn't work

Description

I need to replace Thread.Abort with a different method since it is deprecated in the .NET 8.0 I am using.

The example programs will not compile because all the variable types are not defined. Am I missing something? What is the type supposed to be defined as?

Type ‘Coffee’ is not defined.
Type ‘Egg’ is not defined.
Type ‘HashBrown’ is not defined.
Type ‘Toast’ is not defined.
Type ‘Juice’ is not defined.
Type ‘Toast’ is not defined.
Type ‘Toast’ is not defined.
Type ‘Toast’ is not defined.
Type ‘Toast’ is not defined.
Type ‘HashBrown’ is not defined.

Dim cup As Coffee = PourCoffee()
Console.WriteLine(“Coffee is ready”)
.
.
.
Private Function PourCoffee() As Coffee
Console.WriteLine(“Pouring coffee”)
Return New Coffee()
End Function

Page URL

https://learn.microsoft.com/en-us/dotnet/visual-basic/programming-guide/concepts/async/

Content source URL

https://github.com/dotnet/docs/blob/main/docs/visual-basic/programming-guide/concepts/async/index.md

Document Version Independent Id

550522d6-32ca-b8ba-7c37-5ad054102f0a

Platform Id

53a08a42-376b-6533-6273-1181f1511ca8

Article author

@BillWagner

Metadata

  • ID: d1a9a526-9135-db6b-f84b-ae52ab0876c4
  • PlatformId: 53a08a42-376b-6533-6273-1181f1511ca8
  • Service: dotnet-visualbasic

Related Issues

Metadata

Metadata

Assignees

Type

No type

Projects

Status

🔖 Ready

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    SYSTEM_READY >> ...MS