Name: Xamarin.Build.AsyncTask
Owner: Xamarin
Description: Repository for the AsyncTask and corresponding nuget package
Created: 2017-10-03 16:15:30.0
Updated: 2018-01-22 18:49:20.0
Pushed: 2017-10-25 16:03:53.0
Homepage: null
Size: 11
Language: C#
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Provides the AsyncTask to streamline the creation of long-running tasks that are cancellable and don't block the UI thread in Visual Studio.
ild /t:restore && msbuild
That's it.
all-package Xamarin.Build.AsyncTask
If you're creating a custom task library, just inherit from Xamarin.Build.AsyncTask.
If you're creating an inline task that wants to inherit from AsyncTask, use the following as a template:
singTask TaskName="MyAsyncTask" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll">
<ParameterGroup>
<!-- TODO: your task parameters -->
</ParameterGroup>
<Task>
<Reference Include="$(AsyncTask)" />
<Reference Include="System.Threading.Tasks"/>
<Code Type="Class" Language="cs">
<![CDATA[
public class MyAsyncTask : Xamarin.Build.AsyncTask
{
public override bool Execute()
{
System.Threading.Tasks.Task.Run(async () =>
{
// TODO: do something long-running
await System.Threading.Tasks.Task.Delay(5000);
// Invoke Complete to signal you're done.
Complete();
});
return base.Execute();
}
}
]]>
</Code>
</Task>
UsingTask>
Building and pushing from VSTS.