Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

made CircularDependencyExcpetion class public #5988

Merged
merged 3 commits into from
Dec 23, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions ref/Microsoft.Build/net/Microsoft.Build.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace Microsoft.Build.BackEnd
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We haven't exposed this namespace before, so I think we should move the exception into the Microsoft.Build.Exceptions namespace where the others are:

namespace Microsoft.Build.Exceptions
{
public partial class BuildAbortedException : System.Exception
{

Can you change the namespace in CircularDependencyException.cs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good! I think keeping it protected was causing some error preventing it from building. The build worked on my end, I think the namespace change might resolve that, so I changed it back to protected.

{
public partial class CircularDependencyException : System.Exception
{
public CircularDependencyException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
}
}
namespace Microsoft.Build.Construction
{
public abstract partial class ElementLocation
Expand Down
7 changes: 7 additions & 0 deletions ref/Microsoft.Build/netstandard/Microsoft.Build.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace Microsoft.Build.BackEnd
{
public partial class CircularDependencyException : System.Exception
{
public CircularDependencyException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
}
}
namespace Microsoft.Build.Construction
{
public abstract partial class ElementLocation
Expand Down
4 changes: 2 additions & 2 deletions src/Build/BackEnd/Shared/CircularDependencyException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace Microsoft.Build.BackEnd
/// If you add fields to this class, add a custom serialization constructor and override GetObjectData().
/// </remarks>
[Serializable]
internal class CircularDependencyException : Exception
public class CircularDependencyException : Exception
{
/// <summary>
/// Constructs a standard BuildAbortedException.
Expand All @@ -31,7 +31,7 @@ internal CircularDependencyException(string message)
/// <summary>
/// Constructor for deserialization.
/// </summary>
protected CircularDependencyException(SerializationInfo info, StreamingContext context)
public CircularDependencyException(SerializationInfo info, StreamingContext context)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this change necessary? I think it's ok for this ideally-unused constructor to continue to be protected.

: base(info, context)
{
}
Expand Down