Skip to content

Commit df30c92

Browse files
committed
优化异常输出内容
1 parent 753c664 commit df30c92

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

  • Code/UsingMSBuildCopyOutputFileToFastDebug

Code/UsingMSBuildCopyOutputFileToFastDebug/Program.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,12 @@ static int Main(string[] args)
4747
}
4848
catch (Exception e)
4949
{
50+
#if DEBUG
5051
Logger.Error(e.ToString());
52+
#else
53+
var msBuildException = new MSBuildException(e.Message, e);
54+
msBuildException.ReportBuildError();
55+
#endif
5156
return -1;
5257
}
5358
}
@@ -105,8 +110,6 @@ private static void CopyOutputFile(CopyOutputFileOptions copyOutputFileOptions)
105110
safeOutputFileCopyTask.Execute();
106111
}
107112

108-
109-
110113
/// <summary>
111114
/// 获取准备运行的 Exe 的路径
112115
/// </summary>

0 commit comments

Comments
 (0)