catch clean failure
This commit is contained in:
parent
822f8100a9
commit
f8ebf66dfc
1 changed files with 10 additions and 3 deletions
|
@ -90,7 +90,6 @@ namespace Microsoft.DotNet.Tools.Compiler
|
|||
private static bool CompileNative(ProjectContext context, string configuration, string outputOptionValue, bool buildProjectReferences, string nativeOptionValue)
|
||||
{
|
||||
string outputPath = Path.Combine(GetOutputPath(context, configuration, outputOptionValue), "native");
|
||||
string outputName = Path.Combine(outputPath, Constants.ExeSuffix);
|
||||
|
||||
var compilationOptions = context.ProjectFile.GetCompilerOptions(context.TargetFramework, configuration);
|
||||
var managedBinaryPath = Path.Combine(outputPath, context.ProjectFile.Name + (compilationOptions.EmitEntryPoint.GetValueOrDefault() ? ".exe" : ".dll"));
|
||||
|
@ -307,7 +306,15 @@ namespace Microsoft.DotNet.Tools.Compiler
|
|||
{
|
||||
if (Directory.Exists(path))
|
||||
{
|
||||
Directory.Delete(path, recursive: true);
|
||||
try
|
||||
{
|
||||
Directory.Delete(path, recursive: true);
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
Console.WriteLine("Unable to remove directory: " + path);
|
||||
Console.WriteLine(e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
Directory.CreateDirectory(path);
|
||||
|
|
Loading…
Reference in a new issue