This repository was archived by the owner on Jan 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Expose InternalBufferOverflowException in FSW #11785
Merged
stephentoub
merged 4 commits into
dotnet:master
from
ianhays:api_fsw_internalbufferoverflowexception
Sep 30, 2016
Merged
Changes from all commits
Commits
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
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 |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| <Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
| <Import Project="..\dir.props" /> | ||
| <PropertyGroup> | ||
| <AssemblyVersion>4.0.1.0</AssemblyVersion> | ||
| <AssemblyVersion>4.1.0.0</AssemblyVersion> | ||
| </PropertyGroup> | ||
| </Project> | ||
|
|
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 |
|---|---|---|
|
|
@@ -46,6 +46,14 @@ protected void OnRenamed(System.IO.RenamedEventArgs e) { } | |
| public System.IO.WaitForChangedResult WaitForChanged(System.IO.WatcherChangeTypes changeType) { return default(System.IO.WaitForChangedResult); } | ||
| public System.IO.WaitForChangedResult WaitForChanged(System.IO.WatcherChangeTypes changeType, int timeout) { return default(System.IO.WaitForChangedResult); } | ||
| } | ||
| [Serializable] | ||
| public partial class InternalBufferOverflowException : System.SystemException | ||
| { | ||
| public InternalBufferOverflowException() { } | ||
| public InternalBufferOverflowException(string message) { } | ||
| public InternalBufferOverflowException(string message, System.Exception inner) { } | ||
| protected InternalBufferOverflowException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } | ||
| } | ||
|
Member
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. Since you're adding this, can you add it with the appropriate serialization as well? It should have a protected ctor: protected InternalBufferOverflowException(SerializationInfo info, StreamingContext context) : base (info, context) { }Also, the base type should be SystemException, right? |
||
| [System.FlagsAttribute] | ||
| public enum NotifyFilters | ||
| { | ||
|
|
||
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
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
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 |
|---|---|---|
| @@ -1,28 +1,30 @@ | ||
| { | ||
| "frameworks": { | ||
| "netstandard1.3": { | ||
| "netstandard1.7": { | ||
| "dependencies": { | ||
| "Microsoft.NETCore.Platforms": "1.0.1", | ||
| "Microsoft.Win32.Primitives": "4.0.0", | ||
| "System.Collections": "4.0.0", | ||
| "System.Diagnostics.Debug": "4.0.10", | ||
| "System.Diagnostics.Tools": "4.0.0", | ||
| "System.IO": "4.0.10", | ||
| "System.IO.FileSystem": "4.0.0", | ||
| "System.IO.FileSystem.Primitives": "4.0.0", | ||
| "System.Resources.ResourceManager": "4.0.0", | ||
| "System.Runtime": "4.0.20", | ||
| "System.Runtime.Extensions": "4.0.10", | ||
| "System.Runtime.Handles": "4.0.0", | ||
| "System.Threading": "4.0.10", | ||
| "System.Threading.Tasks": "4.0.10", | ||
| "System.Threading.Thread": "4.0.0" | ||
| }, | ||
| "imports": [ | ||
| "dotnet5.4" | ||
| "Microsoft.Win32.Primitives": "4.3.0-beta-24522-03", | ||
| "System.Collections": "4.3.0-beta-24522-03", | ||
| "System.Diagnostics.Debug": "4.3.0-beta-24522-03", | ||
| "System.Diagnostics.Tools": "4.3.0-beta-24522-03", | ||
| "System.IO": "4.3.0-beta-24522-03", | ||
| "System.IO.FileSystem": "4.3.0-beta-24522-03", | ||
| "System.IO.FileSystem.Primitives": "4.3.0-beta-24522-03", | ||
| "System.Resources.ResourceManager": "4.3.0-beta-24522-03", | ||
| "System.Runtime": "4.3.0-beta-24522-03", | ||
| "System.Runtime.Extensions": "4.3.0-beta-24522-03", | ||
| "System.Runtime.Handles": "4.3.0-beta-24522-03", | ||
| "System.Runtime.InteropServices": "4.3.0-beta-24522-03", | ||
| "System.Threading": "4.3.0-beta-24522-03", | ||
| "System.Threading.Overlapped": "4.3.0-beta-24522-03", | ||
| "System.Threading.Tasks": "4.3.0-beta-24522-03", | ||
| "System.Threading.Thread": "4.3.0-beta-24522-03" | ||
| }, | ||
| "imports": [ | ||
| "dotnet5.8" | ||
| ] | ||
| }, | ||
| "net46": { | ||
| "net463": { | ||
| "dependencies": { | ||
| "Microsoft.TargetingPack.NETFramework.v4.6": "1.0.1" | ||
|
Member
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 should probably update this to be v4.6.2 |
||
| } | ||
|
|
||
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.
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.
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.
Just curious, should this type implement
ISerializable? I ask because usually types that have this attribute also have that interface and it's implementation.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.
not according to the docs
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.
Exception itself implements ISerializable, and it exposes a protected GetObjectData method that a derived exception can override if it has additional state that needs to be serialized... InternalBufferOverflowException doesn't, so it doesn't.
In general, the majority of [Serializable] types don't actually implement ISerializable. When a type is marked as [Serializable], BinaryFormatter does a default serialization, where it serializes all fields (unless they're marked as [NonSerialized]). If you want to customize that behavior, there are a variety of ways, one of which is implementing ISerializable (which provides the GetObjectData method for getting the state to be serialized) and providing a deserialization ctor (one that takes SerializationInfo and StreamingContext)... when you implement ISerializable, BinaryFormatter then defers to the GetObjectData+ctor to serialize and deserialize the instance.
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.
I see, thanks for the explanation @stephentoub 😄