diff --git a/Directory.Build.props b/Directory.Build.props index 95f095732..2c14cc2bd 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,6 +1,7 @@ + true true true $(DefineConstants);$(ExtraDefine) diff --git a/LibGit2Sharp.Tests/desktop/SmartSubtransportFixture.cs b/LibGit2Sharp.Tests/desktop/SmartSubtransportFixture.cs index ff4d0fcd6..bc7e7ac15 100644 --- a/LibGit2Sharp.Tests/desktop/SmartSubtransportFixture.cs +++ b/LibGit2Sharp.Tests/desktop/SmartSubtransportFixture.cs @@ -313,7 +313,7 @@ private HttpWebResponse GetResponseWithRedirects() } // rethrow if it's not 401 - throw ex; + throw; } if (response.StatusCode == HttpStatusCode.Moved || response.StatusCode == HttpStatusCode.Redirect) diff --git a/LibGit2Sharp/AmbiguousSpecificationException.cs b/LibGit2Sharp/AmbiguousSpecificationException.cs index 16c77f6df..4903d9df9 100644 --- a/LibGit2Sharp/AmbiguousSpecificationException.cs +++ b/LibGit2Sharp/AmbiguousSpecificationException.cs @@ -1,13 +1,17 @@ -using LibGit2Sharp.Core; using System; +#if NETFRAMEWORK using System.Runtime.Serialization; +#endif +using LibGit2Sharp.Core; namespace LibGit2Sharp { /// /// The exception that is thrown when the provided specification cannot uniquely identify a reference, an object or a path. /// +#if NETFRAMEWORK [Serializable] +#endif public class AmbiguousSpecificationException : NativeException { /// @@ -30,7 +34,7 @@ public AmbiguousSpecificationException(string message) /// A composite format string for use in . /// An object array that contains zero or more objects to format. public AmbiguousSpecificationException(string format, params object[] args) - : base(String.Format(format, args)) + : base(string.Format(format, args)) { } @@ -43,6 +47,7 @@ public AmbiguousSpecificationException(string message, Exception innerException) : base(message, innerException) { } +#if NETFRAMEWORK /// /// Initializes a new instance of the class with a serialized data. /// @@ -51,6 +56,7 @@ public AmbiguousSpecificationException(string message, Exception innerException) protected AmbiguousSpecificationException(SerializationInfo info, StreamingContext context) : base(info, context) { } +#endif internal override GitErrorCode ErrorCode { diff --git a/LibGit2Sharp/BareRepositoryException.cs b/LibGit2Sharp/BareRepositoryException.cs index 7ee830a0c..461204acd 100644 --- a/LibGit2Sharp/BareRepositoryException.cs +++ b/LibGit2Sharp/BareRepositoryException.cs @@ -1,5 +1,7 @@ using System; +#if NETFRAMEWORK using System.Runtime.Serialization; +#endif using LibGit2Sharp.Core; namespace LibGit2Sharp @@ -8,7 +10,9 @@ namespace LibGit2Sharp /// The exception that is thrown when an operation which requires a /// working directory is performed against a bare repository. /// +#if NETFRAMEWORK [Serializable] +#endif public class BareRepositoryException : NativeException { /// @@ -43,6 +47,7 @@ public BareRepositoryException(string message, Exception innerException) : base(message, innerException) { } +#if NETFRAMEWORK /// /// Initializes a new instance of the class with a serialized data. /// @@ -51,6 +56,7 @@ public BareRepositoryException(string message, Exception innerException) protected BareRepositoryException(SerializationInfo info, StreamingContext context) : base(info, context) { } +#endif internal BareRepositoryException(string message, GitErrorCategory category) : base(message, category) diff --git a/LibGit2Sharp/CheckoutConflictException.cs b/LibGit2Sharp/CheckoutConflictException.cs index f2f5092e9..23b97143e 100644 --- a/LibGit2Sharp/CheckoutConflictException.cs +++ b/LibGit2Sharp/CheckoutConflictException.cs @@ -1,5 +1,7 @@ using System; +#if NETFRAMEWORK using System.Runtime.Serialization; +#endif using LibGit2Sharp.Core; namespace LibGit2Sharp @@ -9,7 +11,9 @@ namespace LibGit2Sharp /// because of a conflicting change staged in the index, or unstaged /// in the working directory. /// +#if NETFRAMEWORK [Serializable] +#endif public class CheckoutConflictException : NativeException { /// @@ -44,6 +48,7 @@ public CheckoutConflictException(string message, Exception innerException) : base(message, innerException) { } +#if NETFRAMEWORK /// /// Initializes a new instance of the class with a serialized data. /// @@ -52,6 +57,7 @@ public CheckoutConflictException(string message, Exception innerException) protected CheckoutConflictException(SerializationInfo info, StreamingContext context) : base(info, context) { } +#endif internal CheckoutConflictException(string message, GitErrorCategory category) : base(message, category) diff --git a/LibGit2Sharp/EmptyCommitException.cs b/LibGit2Sharp/EmptyCommitException.cs index 8cd48e49f..0c247bec7 100644 --- a/LibGit2Sharp/EmptyCommitException.cs +++ b/LibGit2Sharp/EmptyCommitException.cs @@ -1,5 +1,7 @@ using System; +#if NETFRAMEWORK using System.Runtime.Serialization; +#endif namespace LibGit2Sharp { @@ -7,7 +9,9 @@ namespace LibGit2Sharp /// The exception that is thrown when a commit would create an "empty" /// commit that is treesame to its parent without an explicit override. /// +#if NETFRAMEWORK [Serializable] +#endif public class EmptyCommitException : LibGit2SharpException { /// @@ -42,6 +46,7 @@ public EmptyCommitException(string message, Exception innerException) : base(message, innerException) { } +#if NETFRAMEWORK /// /// Initializes a new instance of the class with a serialized data. /// @@ -50,5 +55,6 @@ public EmptyCommitException(string message, Exception innerException) protected EmptyCommitException(SerializationInfo info, StreamingContext context) : base(info, context) { } +#endif } } diff --git a/LibGit2Sharp/EntryExistsException.cs b/LibGit2Sharp/EntryExistsException.cs index 2c46e4acd..8039f5edd 100644 --- a/LibGit2Sharp/EntryExistsException.cs +++ b/LibGit2Sharp/EntryExistsException.cs @@ -1,5 +1,8 @@ using System; +#if NETFRAMEWORK using System.Runtime.Serialization; +#endif + using LibGit2Sharp.Core; namespace LibGit2Sharp @@ -7,7 +10,9 @@ namespace LibGit2Sharp /// /// The exception that is thrown attempting to create a resource that already exists. /// +#if NETFRAMEWORK [Serializable] +#endif public class EntryExistsException : LibGit2SharpException { /// @@ -42,6 +47,7 @@ public EntryExistsException(string message, Exception innerException) : base(message, innerException) { } +#if NETFRAMEWORK /// /// Initializes a new instance of the class with a serialized data. /// @@ -50,6 +56,7 @@ public EntryExistsException(string message, Exception innerException) protected EntryExistsException(SerializationInfo info, StreamingContext context) : base(info, context) { } +#endif internal EntryExistsException(string message, GitErrorCode code, GitErrorCategory category) : base(message, code, category) diff --git a/LibGit2Sharp/InvalidSpecificationException.cs b/LibGit2Sharp/InvalidSpecificationException.cs index 3d34571a4..573a8a1db 100644 --- a/LibGit2Sharp/InvalidSpecificationException.cs +++ b/LibGit2Sharp/InvalidSpecificationException.cs @@ -1,5 +1,7 @@ using System; +#if NETFRAMEWORK using System.Runtime.Serialization; +#endif using LibGit2Sharp.Core; namespace LibGit2Sharp @@ -10,7 +12,9 @@ namespace LibGit2Sharp /// if the spec refers to an object of an incorrect type (e.g. asking to /// create a branch from a blob, or peeling a blob to a commit). /// +#if NETFRAMEWORK [Serializable] +#endif public class InvalidSpecificationException : NativeException { /// @@ -45,6 +49,7 @@ public InvalidSpecificationException(string message, Exception innerException) : base(message, innerException) { } +#if NETFRAMEWORK /// /// Initializes a new instance of the class with a serialized data. /// @@ -53,6 +58,7 @@ public InvalidSpecificationException(string message, Exception innerException) protected InvalidSpecificationException(SerializationInfo info, StreamingContext context) : base(info, context) { } +#endif internal InvalidSpecificationException(string message, GitErrorCategory category) : base(message, category) diff --git a/LibGit2Sharp/LibGit2SharpException.cs b/LibGit2Sharp/LibGit2SharpException.cs index 5d1c33f25..e5d90f61f 100644 --- a/LibGit2Sharp/LibGit2SharpException.cs +++ b/LibGit2Sharp/LibGit2SharpException.cs @@ -1,14 +1,17 @@ using System; using System.Globalization; +#if NETFRAMEWORK using System.Runtime.Serialization; -using LibGit2Sharp.Core; +#endif namespace LibGit2Sharp { /// /// The exception that is thrown when an error occurs during application execution. /// +#if NETFRAMEWORK [Serializable] +#endif public class LibGit2SharpException : Exception { /// @@ -40,10 +43,11 @@ public LibGit2SharpException(string message, Exception innerException) /// A composite format string for use in . /// An object array that contains zero or more objects to format. public LibGit2SharpException(string format, params object[] args) - : base(String.Format(CultureInfo.InvariantCulture, format, args)) + : base(string.Format(CultureInfo.InvariantCulture, format, args)) { } +#if NETFRAMEWORK /// /// Initializes a new instance of the class with a serialized data. /// @@ -52,5 +56,6 @@ public LibGit2SharpException(string format, params object[] args) protected LibGit2SharpException(SerializationInfo info, StreamingContext context) : base(info, context) { } +#endif } } diff --git a/LibGit2Sharp/LockedFileException.cs b/LibGit2Sharp/LockedFileException.cs index 44fd65b02..d58c8dbec 100644 --- a/LibGit2Sharp/LockedFileException.cs +++ b/LibGit2Sharp/LockedFileException.cs @@ -1,5 +1,7 @@ using System; +#if NETFRAMEWORK using System.Runtime.Serialization; +#endif using LibGit2Sharp.Core; namespace LibGit2Sharp @@ -7,7 +9,9 @@ namespace LibGit2Sharp /// /// The exception that is thrown attempting to open a locked file. /// +#if NETFRAMEWORK [Serializable] +#endif public class LockedFileException : NativeException { /// @@ -42,6 +46,7 @@ public LockedFileException(string message, Exception innerException) : base(message, innerException) { } +#if NETFRAMEWORK /// /// Initializes a new instance of the class with a serialized data. /// @@ -50,6 +55,7 @@ public LockedFileException(string message, Exception innerException) protected LockedFileException(SerializationInfo info, StreamingContext context) : base(info, context) { } +#endif internal LockedFileException(string message, GitErrorCategory category) : base(message, category) diff --git a/LibGit2Sharp/MergeFetchHeadNotFoundException.cs b/LibGit2Sharp/MergeFetchHeadNotFoundException.cs index a86bf5caf..34b6b71aa 100644 --- a/LibGit2Sharp/MergeFetchHeadNotFoundException.cs +++ b/LibGit2Sharp/MergeFetchHeadNotFoundException.cs @@ -1,12 +1,16 @@ using System; +#if NETFRAMEWORK using System.Runtime.Serialization; +#endif namespace LibGit2Sharp { /// /// The exception that is thrown when the ref to merge with was as part of a pull operation not fetched. /// +#if NETFRAMEWORK [Serializable] +#endif public class MergeFetchHeadNotFoundException : NotFoundException { /// @@ -41,6 +45,7 @@ public MergeFetchHeadNotFoundException(string message, Exception innerException) : base(message, innerException) { } +#if NETFRAMEWORK /// /// Initializes a new instance of the class with a serialized data. /// @@ -49,5 +54,6 @@ public MergeFetchHeadNotFoundException(string message, Exception innerException) protected MergeFetchHeadNotFoundException(SerializationInfo info, StreamingContext context) : base(info, context) { } +#endif } } diff --git a/LibGit2Sharp/NameConflictException.cs b/LibGit2Sharp/NameConflictException.cs index 0dcffc648..0f4dde744 100644 --- a/LibGit2Sharp/NameConflictException.cs +++ b/LibGit2Sharp/NameConflictException.cs @@ -1,5 +1,7 @@ using System; +#if NETFRAMEWORK using System.Runtime.Serialization; +#endif using LibGit2Sharp.Core; namespace LibGit2Sharp @@ -7,7 +9,9 @@ namespace LibGit2Sharp /// /// The exception that is thrown when a reference, a remote, a submodule... with the same name already exists in the repository /// +#if NETFRAMEWORK [Serializable] +#endif public class NameConflictException : NativeException { /// @@ -42,6 +46,7 @@ public NameConflictException(string message, Exception innerException) : base(message, innerException) { } +#if NETFRAMEWORK /// /// Initializes a new instance of the class with a serialized data. /// @@ -50,6 +55,7 @@ public NameConflictException(string message, Exception innerException) protected NameConflictException(SerializationInfo info, StreamingContext context) : base(info, context) { } +#endif internal NameConflictException(string message, GitErrorCategory category) : base(message, category) diff --git a/LibGit2Sharp/NativeException.cs b/LibGit2Sharp/NativeException.cs index 292372db7..66dc03c57 100644 --- a/LibGit2Sharp/NativeException.cs +++ b/LibGit2Sharp/NativeException.cs @@ -1,16 +1,17 @@ -using LibGit2Sharp.Core; -using System; -using System.Collections.Generic; -using System.Globalization; +using System; +#if NETFRAMEWORK using System.Runtime.Serialization; -using System.Text; +#endif +using LibGit2Sharp.Core; namespace LibGit2Sharp { /// /// An exception thrown that corresponds to a libgit2 (native library) error. /// +#if NETFRAMEWORK [Serializable] +#endif public abstract class NativeException : LibGit2SharpException { /// @@ -32,9 +33,11 @@ internal NativeException(string format, params object[] args) { } +#if NETFRAMEWORK internal NativeException(SerializationInfo info, StreamingContext context) : base(info, context) { } +#endif internal NativeException(string message, GitErrorCategory category) : this(message) { diff --git a/LibGit2Sharp/NonFastForwardException.cs b/LibGit2Sharp/NonFastForwardException.cs index b5a858f47..f63e2eb1d 100644 --- a/LibGit2Sharp/NonFastForwardException.cs +++ b/LibGit2Sharp/NonFastForwardException.cs @@ -1,5 +1,7 @@ using System; +#if NETFRAMEWORK using System.Runtime.Serialization; +#endif using LibGit2Sharp.Core; namespace LibGit2Sharp @@ -8,7 +10,9 @@ namespace LibGit2Sharp /// The exception that is thrown when push cannot be performed /// against the remote without losing commits. /// +#if NETFRAMEWORK [Serializable] +#endif public class NonFastForwardException : NativeException { /// @@ -43,6 +47,7 @@ public NonFastForwardException(string message, Exception innerException) : base(message, innerException) { } +#if NETFRAMEWORK /// /// Initializes a new instance of the class with a serialized data. /// @@ -51,6 +56,7 @@ public NonFastForwardException(string message, Exception innerException) protected NonFastForwardException(SerializationInfo info, StreamingContext context) : base(info, context) { } +#endif internal NonFastForwardException(string message, GitErrorCategory category) : base(message, category) diff --git a/LibGit2Sharp/NotFoundException.cs b/LibGit2Sharp/NotFoundException.cs index f8c49cc91..4aefe3f8a 100644 --- a/LibGit2Sharp/NotFoundException.cs +++ b/LibGit2Sharp/NotFoundException.cs @@ -1,5 +1,7 @@ using System; +#if NETFRAMEWORK using System.Runtime.Serialization; +#endif using LibGit2Sharp.Core; namespace LibGit2Sharp @@ -7,7 +9,9 @@ namespace LibGit2Sharp /// /// The exception that is thrown attempting to reference a resource that does not exist. /// +#if NETFRAMEWORK [Serializable] +#endif public class NotFoundException : NativeException { /// @@ -42,6 +46,7 @@ public NotFoundException(string message, Exception innerException) : base(message, innerException) { } +#if NETFRAMEWORK /// /// Initializes a new instance of the class with a serialized data. /// @@ -50,6 +55,7 @@ public NotFoundException(string message, Exception innerException) protected NotFoundException(SerializationInfo info, StreamingContext context) : base(info, context) { } +#endif internal NotFoundException(string message, GitErrorCategory category) : base(message, category) diff --git a/LibGit2Sharp/PeelException.cs b/LibGit2Sharp/PeelException.cs index d7758d7c9..92a6a0f13 100644 --- a/LibGit2Sharp/PeelException.cs +++ b/LibGit2Sharp/PeelException.cs @@ -1,5 +1,7 @@ using System; +#if NETFRAMEWORK using System.Runtime.Serialization; +#endif using LibGit2Sharp.Core; namespace LibGit2Sharp @@ -8,7 +10,9 @@ namespace LibGit2Sharp /// The exception that is thrown when a tag cannot be peeled to the /// target type due to the object model. /// +#if NETFRAMEWORK [Serializable] +#endif public class PeelException : NativeException { /// @@ -43,6 +47,7 @@ public PeelException(string message, Exception innerException) : base(message, innerException) { } +#if NETFRAMEWORK /// /// Initializes a new instance of the class with a serialized data. /// @@ -51,6 +56,7 @@ public PeelException(string message, Exception innerException) protected PeelException(SerializationInfo info, StreamingContext context) : base(info, context) { } +#endif internal PeelException(string message, GitErrorCategory category) : base(message, category) diff --git a/LibGit2Sharp/RecurseSubmodulesException.cs b/LibGit2Sharp/RecurseSubmodulesException.cs index cf4479701..2269f0d16 100644 --- a/LibGit2Sharp/RecurseSubmodulesException.cs +++ b/LibGit2Sharp/RecurseSubmodulesException.cs @@ -1,5 +1,7 @@ using System; +#if NETFRAMEWORK using System.Runtime.Serialization; +#endif namespace LibGit2Sharp { @@ -8,7 +10,9 @@ namespace LibGit2Sharp /// through submodules. The inner exception contains the exception that was /// initially thrown while operating on the submodule. /// +#if NETFRAMEWORK [Serializable] +#endif public class RecurseSubmodulesException : LibGit2SharpException { /// @@ -34,6 +38,7 @@ public RecurseSubmodulesException(string message, Exception innerException, stri InitialRepositoryPath = initialRepositoryPath; } +#if NETFRAMEWORK /// /// Initializes a new instance of the class with a serialized data. /// @@ -42,5 +47,6 @@ public RecurseSubmodulesException(string message, Exception innerException, stri protected RecurseSubmodulesException(SerializationInfo info, StreamingContext context) : base(info, context) { } +#endif } } diff --git a/LibGit2Sharp/RemoveFromIndexException.cs b/LibGit2Sharp/RemoveFromIndexException.cs index 6d9718c18..37e7daf79 100644 --- a/LibGit2Sharp/RemoveFromIndexException.cs +++ b/LibGit2Sharp/RemoveFromIndexException.cs @@ -1,13 +1,16 @@ using System; -using System.Globalization; +#if NETFRAMEWORK using System.Runtime.Serialization; +#endif namespace LibGit2Sharp { /// /// The exception that is thrown when a file cannot be removed from the index. /// +#if NETFRAMEWORK [Serializable] +#endif public class RemoveFromIndexException : LibGit2SharpException { /// @@ -43,6 +46,7 @@ public RemoveFromIndexException(string message, Exception innerException) : base(message, innerException) { } +#if NETFRAMEWORK /// /// Initializes a new instance of the class with a serialized data. /// @@ -51,5 +55,6 @@ public RemoveFromIndexException(string message, Exception innerException) protected RemoveFromIndexException(SerializationInfo info, StreamingContext context) : base(info, context) { } +#endif } } diff --git a/LibGit2Sharp/RepositoryNotFoundException.cs b/LibGit2Sharp/RepositoryNotFoundException.cs index 2255c0891..2e8deb393 100644 --- a/LibGit2Sharp/RepositoryNotFoundException.cs +++ b/LibGit2Sharp/RepositoryNotFoundException.cs @@ -1,5 +1,7 @@ using System; +#if NETFRAMEWORK using System.Runtime.Serialization; +#endif namespace LibGit2Sharp { @@ -7,7 +9,9 @@ namespace LibGit2Sharp /// The exception that is thrown when a is being built with /// a path that doesn't point at a valid Git repository or workdir. /// +#if NETFRAMEWORK [Serializable] +#endif public class RepositoryNotFoundException : LibGit2SharpException { /// @@ -42,6 +46,7 @@ public RepositoryNotFoundException(string message, Exception innerException) : base(message, innerException) { } +#if NETFRAMEWORK /// /// Initializes a new instance of the class with a serialized data. /// @@ -50,5 +55,6 @@ public RepositoryNotFoundException(string message, Exception innerException) protected RepositoryNotFoundException(SerializationInfo info, StreamingContext context) : base(info, context) { } +#endif } } diff --git a/LibGit2Sharp/UnbornBranchException.cs b/LibGit2Sharp/UnbornBranchException.cs index 34ef437cb..8f56eed3d 100644 --- a/LibGit2Sharp/UnbornBranchException.cs +++ b/LibGit2Sharp/UnbornBranchException.cs @@ -1,5 +1,7 @@ using System; +#if NETFRAMEWORK using System.Runtime.Serialization; +#endif namespace LibGit2Sharp { @@ -7,7 +9,9 @@ namespace LibGit2Sharp /// The exception that is thrown when a operation requiring an existing /// branch is performed against an unborn branch. /// +#if NETFRAMEWORK [Serializable] +#endif public class UnbornBranchException : LibGit2SharpException { /// @@ -42,6 +46,7 @@ public UnbornBranchException(string message, Exception innerException) : base(message, innerException) { } +#if NETFRAMEWORK /// /// Initializes a new instance of the class with a serialized data. /// @@ -50,5 +55,6 @@ public UnbornBranchException(string message, Exception innerException) protected UnbornBranchException(SerializationInfo info, StreamingContext context) : base(info, context) { } +#endif } } diff --git a/LibGit2Sharp/UnmatchedPathException.cs b/LibGit2Sharp/UnmatchedPathException.cs index 7d118346d..daf48db6d 100644 --- a/LibGit2Sharp/UnmatchedPathException.cs +++ b/LibGit2Sharp/UnmatchedPathException.cs @@ -1,12 +1,16 @@ using System; +#if NETFRAMEWORK using System.Runtime.Serialization; +#endif namespace LibGit2Sharp { /// /// The exception that is thrown when an explicit path or a list of explicit paths could not be matched. /// +#if NETFRAMEWORK [Serializable] +#endif public class UnmatchedPathException : LibGit2SharpException { /// @@ -41,6 +45,7 @@ public UnmatchedPathException(string message, Exception innerException) : base(message, innerException) { } +#if NETFRAMEWORK /// /// Initializes a new instance of the class with a serialized data. /// @@ -49,5 +54,6 @@ public UnmatchedPathException(string message, Exception innerException) protected UnmatchedPathException(SerializationInfo info, StreamingContext context) : base(info, context) { } +#endif } } diff --git a/LibGit2Sharp/UnmergedIndexEntriesException.cs b/LibGit2Sharp/UnmergedIndexEntriesException.cs index 7594049b1..ca01c256d 100644 --- a/LibGit2Sharp/UnmergedIndexEntriesException.cs +++ b/LibGit2Sharp/UnmergedIndexEntriesException.cs @@ -1,5 +1,7 @@ using System; +#if NETFRAMEWORK using System.Runtime.Serialization; +#endif using LibGit2Sharp.Core; namespace LibGit2Sharp @@ -8,7 +10,9 @@ namespace LibGit2Sharp /// The exception that is thrown when an operation that requires a fully merged index /// is performed against an index with unmerged entries /// +#if NETFRAMEWORK [Serializable] +#endif public class UnmergedIndexEntriesException : NativeException { /// @@ -43,6 +47,7 @@ public UnmergedIndexEntriesException(string message, Exception innerException) : base(message, innerException) { } +#if NETFRAMEWORK /// /// Initializes a new instance of the class with a serialized data. /// @@ -51,6 +56,7 @@ public UnmergedIndexEntriesException(string message, Exception innerException) protected UnmergedIndexEntriesException(SerializationInfo info, StreamingContext context) : base(info, context) { } +#endif internal UnmergedIndexEntriesException(string message, GitErrorCategory category) : base(message, category) diff --git a/LibGit2Sharp/UserCanceledException.cs b/LibGit2Sharp/UserCanceledException.cs index ba6458049..0139bdb1c 100644 --- a/LibGit2Sharp/UserCanceledException.cs +++ b/LibGit2Sharp/UserCanceledException.cs @@ -1,5 +1,7 @@ using System; +#if NETFRAMEWORK using System.Runtime.Serialization; +#endif using LibGit2Sharp.Core; namespace LibGit2Sharp @@ -7,7 +9,9 @@ namespace LibGit2Sharp /// /// The exception that is thrown when an operation is canceled. /// +#if NETFRAMEWORK [Serializable] +#endif public class UserCancelledException : NativeException { /// @@ -42,6 +46,7 @@ public UserCancelledException(string message, Exception innerException) : base(message, innerException) { } +#if NETFRAMEWORK /// /// Initializes a new instance of the class with a serialized data. /// @@ -50,6 +55,7 @@ public UserCancelledException(string message, Exception innerException) protected UserCancelledException(SerializationInfo info, StreamingContext context) : base(info, context) { } +#endif internal UserCancelledException(string message, GitErrorCategory category) : base(message, category)