Skip to content

<RemoveDirFixed/> MSBuild task can take 8+ seconds #10338

@jonathanpeppers

Description

@jonathanpeppers

Android framework version

net10.0-android (Preview)

Affected platform version

.NET 10

Description

I was testing another issue and noticed this!

Image

By default, we allow 10 retries with a 1 second sleep:

For this case, we are working with a temp file and so it's really "best" effort to delete it.

Let's introduce an MSBuild task parameter to configure retries to <RemoveDirFixed/>, and set it to 3 for cases where we are deleting temp files and have ContinueOnError="WarnAndContinue".

<!-- Delete our temporary directory -->
<RemoveDirFixed
Directories="$(ResgenTemporaryDirectory)"
ContinueOnError="WarnAndContinue"
/>

We could add new parameters that if set replaces these values:

int attempts = Files.GetFileWriteRetryAttempts ();
int delay = Files.GetFileWriteRetryDelay ();

Steps to Reproduce

  1. dotnet new maui-blazor-web in VS
  2. F5

Did you find any workaround?

No response

Relevant log output

RemoveDirFixed.zip

Metadata

Metadata

Assignees

Labels

Area: App+Library BuildIssues when building Library projects or Application projects.Area: PerformanceIssues with performance.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions