-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Suppress warnings about breaking changes to Newtonsoft.Json dependency in SignalR #9405
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
Build Errors | ||
------------ | ||
|
||
This document is for common build errors and how to resolve them. | ||
|
||
### Warning BUILD001 | ||
|
||
> warning BUILD001: Package references changed since the last release... | ||
|
||
This warning indicates a breaking change might have been made to a package or assembly due to the removal of a reference which was used | ||
in a previous release of this assembly. See <./ReferenceResolution.md> for how to suppress. | ||
|
||
### Error BUILD002 | ||
|
||
> error BUILD002: Package references changed since the last release... | ||
|
||
Similar to BUILD001, but this error is not suppressable. This error only appears in servicing builds, which should not change references between assemblies or packages. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,7 @@ The requirements that led to this system are: | |
* Name the .csproj file to match the assembly name. | ||
* Run `build.cmd /t:GenerateProjectList` when adding new projects | ||
* Use [eng/tools/BaseLineGenerator/](/eng/tools/BaselineGenerator/README.md) if you need to update baselines. | ||
* If you need to make a breaking change to dependencies, you may need to add `<SuppressBaselineReference>`. | ||
|
||
## Important files | ||
|
||
|
@@ -67,3 +68,16 @@ Steps for adding a new package dependency to an existing project. Let's say I'm | |
|
||
If you don't know the commit hash of the source code used to produce "0.0.1-beta-1", you can use `000000` as a placeholder for `Sha` | ||
as its value is unimportant and will be updated the next time the bot runs. | ||
|
||
## Example: make a breaking change to references | ||
|
||
If Microsoft.AspNetCore.Banana in 2.1 had a reference to `Microsoft.AspNetCore.Orange`, but in 3.0 this reference is changing to `Microsoft.AspNetCore.BetterThanOrange`, you would need to make these changes to the .csproj file | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🍌 is already better than orange (🔶) ❕ |
||
|
||
```diff | ||
<!-- in Microsoft.AspNetCore.Banana.csproj --> | ||
<ItemGroup> | ||
- <Reference Include="Microsoft.AspNetCore.Orange" /> <!-- the old dependency --> | ||
+ <Reference Include="Microsoft.AspNetCore.BetterThanOrange" /> <!-- the new dependency --> | ||
+ <SuppressBaselineReference Include="Microsoft.AspNetCore.Orange" /> <!-- suppress as a known breaking change --> | ||
</ItemGroup> | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,4 +28,9 @@ | |
<Reference Include="System.Threading.Channels" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Condition="'$(AspNetCoreMajorMinorVersion)' == '3.0'"> | ||
<!-- This dependency was replaced by Protocols.NewtonsoftJson between 3.0 and 2.2. This suppression can be removed after 3.0 is complete. --> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we file an issue to do this after branching for 3.0? I guess it's not a big deal if we don't remove it right away. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, such an issue is likely to get lost between now and RTM if it has to wait in the backlog. But, if you create a 4.0 milestone for it, that'll work. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't need to file an issue, this will go away when we make System.Text.Json the default. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It doesn't hurt if it stays around, but feel free to file an issue to clean up later. I'm writing these suppressions with the condition that checks version to makes sure the code doesn't become a problem later when we branch for 3.1 and beyond. |
||
<SuppressBaselineReference Include="Microsoft.AspNetCore.SignalR.Protocols.Json" /> | ||
</ItemGroup> | ||
|
||
</Project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,4 +27,9 @@ | |
<Reference Include="System.Runtime.CompilerServices.Unsafe" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Condition="'$(AspNetCoreMajorMinorVersion)' == '3.0'"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is technically a new package in 3.0. We replaced the old Microsoft.AspNetCore.SignalR.Protocols.Json package with the Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson package and then removed the old one. So this is now a new package and probably shouldn't have a baseline associated with it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Even so, it's the same package ID and the build system (and users) see this as a breaking change. It's okay since this was planned. This documents that intention in the code. |
||
<!-- This dependency was replaced by System.Text.Json between 3.0 and 2.2. This suppression can be removed after 3.0 is complete. --> | ||
<SuppressBaselineReference Include="Newtonsoft.Json" /> | ||
</ItemGroup> | ||
|
||
</Project> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏 👏 👏 👏 👏 👏