-
Notifications
You must be signed in to change notification settings - Fork 6.1k
add docs for MSBuild breaking change around serialization of certain types #29311
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
Merged
IEvangelist
merged 7 commits into
dotnet:main
from
baronfel:msbuild-customformatting-breaking-change
May 11, 2022
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
f672198
add docs for MSBuild breaking change around serialization of certain …
baronfel 013d96f
Apply uncontroversial suggestions from code review
baronfel a79f00e
add TOC sections
baronfel e3e5936
Apply suggestions from code review
baronfel 7f20574
Apply suggestions from code review
baronfel 5fd434c
Update custom-serialization.md
baronfel f29329c
Update custom-serialization.md
baronfel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| --- | ||
| title: "Breaking change: Serialization of custom types in .NET 7" | ||
| description: Learn about a breaking change in MSBuild for .NET 7 where serialization using BinaryFormatter of certain user-defined types is removed. | ||
| author: baronfel | ||
| ms.date: 05/06/2022 | ||
| --- | ||
|
|
||
| # BinaryFormatter serialization of custom BuildEventArgs and ITaskItems removed for .NET 7 | ||
|
|
||
| MSBuild in .NET 7 doesn't support serialization of custom `BuildEventArgs`-derived and `ITaskItem`-derived types via the `BinaryFormatter` serializer. | ||
|
|
||
| ## Version introduced | ||
|
|
||
| MSBuild 17.4 (.NET SDK 7.0.100) | ||
|
|
||
| ## Old behavior | ||
|
|
||
| MSBuild used BinaryFormatter to preserve custom types that derived from BuildEventArgs and ITaskItem across certain boundaries, most notably when running in a multi-process environment. | ||
|
|
||
| ## New behavior | ||
|
|
||
| MSBuild will no longer support this mechanism, so code that used custom types derived from BuildEventArgs and ITaskItem may fail. | ||
|
|
||
| ## Reason for change | ||
|
|
||
| BinaryFormatter was [made obsolete in .NET 5](https://github.com/dotnet/designs/blob/main/accepted/2020/better-obsoletion/binaryformatter-obsoletion.md). Per this plan, all first-party code in the dotnet GitHub organization must migrate away from its use by .NET 7. This change impacts user-exposed functionality of MSBuild. | ||
|
|
||
| ## Recommended action | ||
|
|
||
| * Engage with the MSBuild team on [this GitHub discussion](https://github.com/dotnet/msbuild/discussions/7582) about your specific use cases and how you can migrate away from the `TranslateDotNet` mechanism. | ||
|
|
||
| * Avoid returning custom derived types from tasks or when logging. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.