Skip to content

Missing await on an async method call? #3007

@Earl-Brown

Description

@Earl-Brown

The example for repairing a model reads:

private async void OnFixClick(object sender, RoutedEventArgs e) {

    // read the loaded file's data as a data stream
    IRandomAccessStream fileStream = await file.OpenAsync(FileAccessMode.Read);

    // assign a Printing3DModel to this data stream
    Printing3DModel model = await package.LoadModelFromPackageAsync(fileStream);

    // use Printing3DModel's repair function
    OutputTextBlock.Text = "repairing model";
    var data = model.RepairAsync();

then states:

The Printing3DModel object is now repaired and printable. Use SaveModelToPackageAsync to assign the model to the Printing3D3MFPackage object that you declared when creating the class.

won't data actually be a Task of some sort, since the call was not awaited?


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions