/// <inheritdoc /> protected MSBuildException(SerializationInfo serializationInfo, StreamingContext streamingContext) : base(serializationInfo, streamingContext) { MSBuildMessage = new MSBuildMessage(DefaultMessage); }
/// <summary> /// 用一个 MSBuild 控制台消息创建一个包含内部异常的编译错误。 /// </summary> /// <param name="message">MSBuild 控制台消息。</param> /// <param name="innerException">内部异常。</param> internal MSBuildException(MSBuildMessage message, Exception innerException) : base(message?.ToString(MessageLevel.Error) ?? throw new ArgumentNullException(nameof(message)), innerException) { MSBuildMessage = message; }
/// <inheritdoc /> public MSBuildException(string message) : base(message) { MSBuildMessage = new MSBuildMessage(message); }
/// <inheritdoc /> public MSBuildException(string message, Exception innerException) : base(message, innerException) { MSBuildMessage = new MSBuildMessage(message); }
/// <summary> /// 尽量不要使用此构造函数来创建,因为这样会缺少有效的信息用于修复编译错误。 /// </summary> public MSBuildException() : base(DefaultMessage) { MSBuildMessage = new MSBuildMessage(DefaultMessage); }