When profile directory does not exist Then skip MCJ
This commit is contained in:
parent
9f0dab1a08
commit
333fbbd167
1 changed files with 18 additions and 1 deletions
|
@ -36,11 +36,28 @@ namespace Microsoft.DotNet.Cli
|
|||
{
|
||||
var profileOptimizationRootPath = new MulticoreJitProfilePathCalculator().MulticoreJitProfilePath;
|
||||
|
||||
PathUtility.EnsureDirectory(profileOptimizationRootPath);
|
||||
if (!TryEnsureDirectory(profileOptimizationRootPath))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
AssemblyLoadContext.Default.SetProfileOptimizationRoot(profileOptimizationRootPath);
|
||||
|
||||
AssemblyLoadContext.Default.StartProfileOptimization("dotnet");
|
||||
}
|
||||
|
||||
private bool TryEnsureDirectory(string directoryPath)
|
||||
{
|
||||
try
|
||||
{
|
||||
PathUtility.EnsureDirectory(directoryPath);
|
||||
|
||||
return true;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue