我有一个构建过程很长的android解决方案。我做了一个gradle配置文件,发现执行“ platformAttrExtractor”任务花费的时间过长(超过6分钟),我想知道该任务是什么,因为我无法在线找到有关该任务的信息,以及如何减少它的信息。运行。
我遇到了一个问题,我需要在主窗口打开和显示之前运行异步任务。IE
[STAThread]
static void Main(string[] args)
MainWindow window = new MainWindow();
SplashScreen.Show("Authenticating");
await Authenticate(); // Need something similar to this....
SplashScreen.Close();
new Application().Run(window);
}
static async Task Authenticate()
{
// Load Local Auth Data
var result = await Authenticator.Authenticate(); // Validates google token with webservice
if (result.GoogleReauthRequired)
{
if (MessageBox.Show(......) == MessageBoxResult.Yes)
{
Google.Reauthenticate();// Opens web browser for account to be logged into using OAuth
result = await Authenticator.Authenticate();
}
}
// Initialize state
}
Run Code Online (Sandbox Code Playgroud)
不幸的是,由于启动 Main 函数不是异步的(也不能因为它是 STAThread)。我不能像上图那样简单地做到这一点。
我尝试了其他几种方法,例如: …