using System;
using System.Runtime.Serialization;
+using System.Security.Permissions;
using Microsoft.Build.Framework;
namespace Microsoft.Build.BuildEngine {
string helpKeyword;
public InternalLoggerException ()
- : base ("Internal logger exception has occured.")
{
+ throw new System.InvalidOperationException (
+ "An InternalLoggerException can only be thrown by the MSBuild engine. " +
+ "The public constructors of this class cannot be used to create an " +
+ "instance of the exception.");
}
public InternalLoggerException (string message)
- : base (message)
+ : this ()
{
}
- public InternalLoggerException (string message,
- Exception innerException)
- : base (message, innerException)
+ public InternalLoggerException (string message, Exception innerException)
+ : this ()
{
}
+ // FIXME: I made it private temporarily, later we can change it to internal (but not protected)
+ private InternalLoggerException (SerializationInfo info, StreamingContext context)
+ : base (info, context)
+ {
+ buildEventArgs = (BuildEventArgs) info.GetValue ("BuildEventArgs", typeof (BuildEventArgs));
+ errorCode = info.GetString ("ErrorCode");
+ helpKeyword = info.GetString ("HelpKeywordPrefix");
+ }
+
+ [SecurityPermission (SecurityAction.LinkDemand, SerializationFormatter = true)]
public override void GetObjectData (SerializationInfo info,
StreamingContext context)
{
}
}
-#endif
\ No newline at end of file
+#endif