From a68b3fa2167d63f7b895c1196e65079052af8029 Mon Sep 17 00:00:00 2001 From: "Docs.Archive pipeline" Date: Fri, 31 Mar 2023 19:45:32 +0000 Subject: [PATCH 1/5] [DocsArchive-1.0.23045.1](2023-03-31-19-44-35)Auto archive content --- .openpublishing.redirection.json | 50 +++ docs/fundamentals/toc.yml | 361 +++++++++--------- .../serialization/basic-serialization.md | 93 ----- .../serialization/binary-serialization.md | 346 ----------------- .../binaryformatter-event-source.md | 110 ------ .../serialization/custom-serialization.md | 175 --------- .../how-to-chunk-serialized-data.md | 59 --- .../serialization/selective-serialization.md | 33 -- .../serialization/serialization-concepts.md | 33 -- .../serialization/serialization-guidelines.md | 144 ------- .../steps-in-the-serialization-process.md | 27 -- .../version-tolerant-serialization.md | 288 -------------- 12 files changed, 220 insertions(+), 1499 deletions(-) delete mode 100644 docs/standard/serialization/basic-serialization.md delete mode 100644 docs/standard/serialization/binary-serialization.md delete mode 100644 docs/standard/serialization/binaryformatter-event-source.md delete mode 100644 docs/standard/serialization/custom-serialization.md delete mode 100644 docs/standard/serialization/how-to-chunk-serialized-data.md delete mode 100644 docs/standard/serialization/selective-serialization.md delete mode 100644 docs/standard/serialization/serialization-concepts.md delete mode 100644 docs/standard/serialization/serialization-guidelines.md delete mode 100644 docs/standard/serialization/steps-in-the-serialization-process.md delete mode 100644 docs/standard/serialization/version-tolerant-serialization.md diff --git a/.openpublishing.redirection.json b/.openpublishing.redirection.json index 809da45e8afc8..8bdaec37241b9 100644 --- a/.openpublishing.redirection.json +++ b/.openpublishing.redirection.json @@ -1,5 +1,55 @@ { "redirections": [ + { + "source_path": "docs/standard/serialization/binary-serialization.md", + "redirect_url": "/previous-versions/dotnet/standard/serialization/binary-serialization", + "redirect_document_id": false + }, + { + "source_path": "docs/standard/serialization/binaryformatter-event-source.md", + "redirect_url": "/previous-versions/dotnet/standard/serialization/binaryformatter-event-source", + "redirect_document_id": false + }, + { + "source_path": "docs/standard/serialization/serialization-concepts.md", + "redirect_url": "/previous-versions/dotnet/standard/serialization/serialization-concepts", + "redirect_document_id": false + }, + { + "source_path": "docs/standard/serialization/basic-serialization.md", + "redirect_url": "/previous-versions/dotnet/standard/serialization/basic-serialization", + "redirect_document_id": false + }, + { + "source_path": "docs/standard/serialization/selective-serialization.md", + "redirect_url": "/previous-versions/dotnet/standard/serialization/selective-serialization", + "redirect_document_id": false + }, + { + "source_path": "docs/standard/serialization/custom-serialization.md", + "redirect_url": "/previous-versions/dotnet/standard/serialization/custom-serialization", + "redirect_document_id": false + }, + { + "source_path": "docs/standard/serialization/steps-in-the-serialization-process.md", + "redirect_url": "/previous-versions/dotnet/standard/serialization/steps-in-the-serialization-process", + "redirect_document_id": false + }, + { + "source_path": "docs/standard/serialization/version-tolerant-serialization.md", + "redirect_url": "/previous-versions/dotnet/standard/serialization/version-tolerant-serialization", + "redirect_document_id": false + }, + { + "source_path": "docs/standard/serialization/serialization-guidelines.md", + "redirect_url": "/previous-versions/dotnet/standard/serialization/serialization-guidelines", + "redirect_document_id": false + }, + { + "source_path": "docs/standard/serialization/how-to-chunk-serialized-data.md", + "redirect_url": "/previous-versions/dotnet/standard/serialization/how-to-chunk-serialized-data", + "redirect_document_id": false + }, { "source_path_from_root": "/docs/about/index.md", "redirect_url": "/dotnet/fundamentals/" diff --git a/docs/fundamentals/toc.yml b/docs/fundamentals/toc.yml index 7a982e78082f5..281ba90fad1de 100644 --- a/docs/fundamentals/toc.yml +++ b/docs/fundamentals/toc.yml @@ -92,69 +92,69 @@ items: - name: Use Visual Studio items: - name: Create a console app - href: ../core/tutorials/with-visual-studio.md displayName: tutorials, visual studio, vs + href: ../core/tutorials/with-visual-studio.md - name: Debug an app - href: ../core/tutorials/debugging-with-visual-studio.md displayName: tutorials, visual studio, vs + href: ../core/tutorials/debugging-with-visual-studio.md - name: Publish an app - href: ../core/tutorials/publishing-with-visual-studio.md displayName: tutorials, visual studio, vs + href: ../core/tutorials/publishing-with-visual-studio.md - name: Create a library - href: ../core/tutorials/library-with-visual-studio.md displayName: tutorials, visual studio, vs + href: ../core/tutorials/library-with-visual-studio.md - name: Unit test a library - href: ../core/tutorials/testing-library-with-visual-studio.md displayName: tutorials, visual studio, vs + href: ../core/tutorials/testing-library-with-visual-studio.md - name: Install and use a package - href: /nuget/quickstart/install-and-use-a-package-in-visual-studio?toc=/dotnet/fundamentals/toc.json&bc=/dotnet/breadcrumb/toc.json displayName: tutorials, visual studio, vs + href: /nuget/quickstart/install-and-use-a-package-in-visual-studio?toc=/dotnet/fundamentals/toc.json&bc=/dotnet/breadcrumb/toc.json - name: Create and publish a package - href: /nuget/quickstart/create-and-publish-a-package-using-visual-studio?toc=/dotnet/fundamentals/toc.json&bc=/dotnet/breadcrumb/toc.json displayName: tutorials, visual studio, vs + href: /nuget/quickstart/create-and-publish-a-package-using-visual-studio?toc=/dotnet/fundamentals/toc.json&bc=/dotnet/breadcrumb/toc.json - name: Use Visual Studio Code items: - name: Create a console app - href: ../core/tutorials/with-visual-studio-code.md displayName: tutorials, visual studio code, vs code, cli + href: ../core/tutorials/with-visual-studio-code.md - name: Debug an app - href: ../core/tutorials/debugging-with-visual-studio-code.md displayName: tutorials, visual studio code, vs code + href: ../core/tutorials/debugging-with-visual-studio-code.md - name: Publish an app - href: ../core/tutorials/publishing-with-visual-studio-code.md displayName: tutorials, visual studio code, vs code + href: ../core/tutorials/publishing-with-visual-studio-code.md - name: Create a library - href: ../core/tutorials/library-with-visual-studio-code.md displayName: tutorials, visual studio code, vs code + href: ../core/tutorials/library-with-visual-studio-code.md - name: Unit test a library - href: ../core/tutorials/testing-library-with-visual-studio-code.md displayName: tutorials, visual studio code, vs code + href: ../core/tutorials/testing-library-with-visual-studio-code.md - name: Install and use a package - href: /nuget/quickstart/install-and-use-a-package-using-the-dotnet-cli?toc=/dotnet/fundamentals/toc.json&bc=/dotnet/breadcrumb/toc.json displayName: tutorials, cli + href: /nuget/quickstart/install-and-use-a-package-using-the-dotnet-cli?toc=/dotnet/fundamentals/toc.json&bc=/dotnet/breadcrumb/toc.json - name: Create and publish a package - href: /nuget/quickstart/create-and-publish-a-package-using-the-dotnet-cli?toc=/dotnet/fundamentals/toc.json&bc=/dotnet/breadcrumb/toc.json displayName: tutorials + href: /nuget/quickstart/create-and-publish-a-package-using-the-dotnet-cli?toc=/dotnet/fundamentals/toc.json&bc=/dotnet/breadcrumb/toc.json - name: Use Visual Studio for Mac items: - name: Create a console app - href: ../core/tutorials/with-visual-studio-mac.md displayName: tutorials, visual studio for mac, vs for mac, cli + href: ../core/tutorials/with-visual-studio-mac.md - name: Debug an app - href: ../core/tutorials/debugging-with-visual-studio-mac.md displayName: tutorials, visual studio for mac, vs for mac + href: ../core/tutorials/debugging-with-visual-studio-mac.md - name: Publish an app - href: ../core/tutorials/publishing-with-visual-studio-mac.md displayName: tutorials, visual studio for mac, vs for mac + href: ../core/tutorials/publishing-with-visual-studio-mac.md - name: Create a library - href: ../core/tutorials/library-with-visual-studio-mac.md displayName: tutorials, visual studio for mac, vs for mac + href: ../core/tutorials/library-with-visual-studio-mac.md - name: Unit test a library - href: ../core/tutorials/testing-library-with-visual-studio-mac.md displayName: tutorials, visual studio for mac, vs for mac + href: ../core/tutorials/testing-library-with-visual-studio-mac.md - name: Install and use a package - href: /nuget/quickstart/install-and-use-a-package-in-visual-studio-mac?toc=/dotnet/fundamentals/toc.json&bc=/dotnet/breadcrumb/toc.json displayName: tutorials, visual studio for mac, vs for mac + href: /nuget/quickstart/install-and-use-a-package-in-visual-studio-mac?toc=/dotnet/fundamentals/toc.json&bc=/dotnet/breadcrumb/toc.json - name: More tutorials href: ../core/tutorials/index.md - name: What's new in .NET @@ -246,8 +246,8 @@ items: - name: Collections and data structures items: - name: Overview - href: ../standard/collections/index.md displayName: collections, data structures + href: ../standard/collections/index.md - name: Select a collection class href: ../standard/collections/selecting-a-collection-class.md - name: Commonly used collection types @@ -267,8 +267,8 @@ items: - name: Events items: - name: Overview - href: ../standard/events/index.md displayName: events + href: ../standard/events/index.md - name: Raise and consume events href: ../standard/events/how-to-raise-and-consume-events.md - name: Handle multiple events using event properties @@ -276,19 +276,19 @@ items: - name: Observer design pattern items: - name: Overview - href: ../standard/events/observer-design-pattern.md displayName: Observer design pattern + href: ../standard/events/observer-design-pattern.md - name: Best practices href: ../standard/events/observer-design-pattern-best-practices.md - - name: "How to: Implement a provider" + - name: 'How to: Implement a provider' href: ../standard/events/how-to-implement-a-provider.md - - name: "How to: Implement an observer" + - name: 'How to: Implement an observer' href: ../standard/events/how-to-implement-an-observer.md - name: Exceptions items: - name: Overview - href: ../standard/exceptions/index.md displayName: exceptions + href: ../standard/exceptions/index.md - name: Exception class and properties href: ../standard/exceptions/exception-class-and-properties.md - name: How-tos @@ -316,7 +316,7 @@ items: - name: Dates, times, and time zones items: - name: Overview - displayName: dates,times,time zones + displayName: dates,times,time zones href: ../standard/datetime/index.md - name: Choose which date and time type to use href: ../standard/datetime/choosing-between-datetime.md @@ -326,7 +326,7 @@ items: href: ../standard/datetime/how-to-use-dateonly-timeonly.md - name: Perform arithmetic operations href: ../standard/datetime/performing-arithmetic-operations.md - - name: "DateTime and DateTimeOffset support in System.Text.Json" + - name: DateTime and DateTimeOffset support in System.Text.Json href: ../standard/datetime/system-text-json-support.md - name: Time zones items: @@ -338,9 +338,9 @@ items: href: ../standard/datetime/converting-between-datetime-and-offset.md - name: Convert times between time zones href: ../standard/datetime/converting-between-time-zones.md - - name: "How to: Resolve ambiguous times" + - name: 'How to: Resolve ambiguous times' href: ../standard/datetime/resolve-ambiguous-times.md - - name: "How to: Let users resolve ambiguous times" + - name: 'How to: Let users resolve ambiguous times' href: ../standard/datetime/let-users-resolve-ambiguous-times.md - name: Instantiate a DateTimeOffset object items: @@ -371,8 +371,8 @@ items: - name: Attributes items: - name: Overview - href: ../standard/attributes/index.md displayName: attributes + href: ../standard/attributes/index.md - name: Apply attributes href: ../standard/attributes/applying-attributes.md - name: Write custom attributes @@ -444,8 +444,8 @@ items: - name: Basic string operations items: - name: Overview - href: ../standard/base-types/basic-string-operations.md displayName: string operations + href: ../standard/base-types/basic-string-operations.md - name: Create new strings href: ../standard/base-types/creating-new.md - name: Trim and remove characters @@ -460,7 +460,7 @@ items: href: ../standard/base-types/divide-up-strings.md - name: Use the StringBuilder class href: ../standard/base-types/stringbuilder.md - - name: "How to: Perform basic string manipulations" + - name: 'How to: Perform basic string manipulations' href: ../standard/base-types/basic-manipulations.md - name: Parse (convert) strings items: @@ -475,11 +475,11 @@ items: - name: Regular expressions items: - name: Overview - href: ../standard/base-types/regular-expressions.md displayName: regular expressions + href: ../standard/base-types/regular-expressions.md - name: Source generation - href: ../standard/base-types/regular-expression-source-generators.md displayName: regular expressions,advanced,design concepts,source generators,algorithmic reduction,regex + href: ../standard/base-types/regular-expression-source-generators.md - name: Language reference items: - name: Overview @@ -537,8 +537,8 @@ items: - name: JSON serialization items: - name: Overview - href: ../standard/serialization/system-text-json/overview.md displayName: json serialization + href: ../standard/serialization/system-text-json/overview.md - name: Reflection vs. source generation href: ../standard/serialization/system-text-json/source-generation-modes.md - name: How to serialize and deserialize JSON @@ -587,29 +587,8 @@ items: href: ../standard/serialization/system-text-json/custom-contracts.md - name: Binary serialization items: - - name: Overview - href: ../standard/serialization/binary-serialization.md - displayName: binary serialization - name: BinaryFormatter security guide href: ../standard/serialization/binaryformatter-security-guide.md - - name: BinaryFormatter event source - href: ../standard/serialization/binaryformatter-event-source.md - - name: Serialization concepts - href: ../standard/serialization/serialization-concepts.md - - name: Basic serialization - href: ../standard/serialization/basic-serialization.md - - name: Selective serialization - href: ../standard/serialization/selective-serialization.md - - name: Custom serialization - href: ../standard/serialization/custom-serialization.md - - name: Steps in the serialization process - href: ../standard/serialization/steps-in-the-serialization-process.md - - name: Version-tolerant serialization - href: ../standard/serialization/version-tolerant-serialization.md - - name: Serialization guidelines - href: ../standard/serialization/serialization-guidelines.md - - name: "How to: Chunk serialized data" - href: ../standard/serialization/how-to-chunk-serialized-data.md - name: XML and SOAP serialization items: - name: Overview @@ -695,29 +674,29 @@ items: - name: Common I/O tasks href: ../standard/io/common-i-o-tasks.md items: - - name: "How to: Copy Directories" + - name: 'How to: Copy Directories' href: ../standard/io/how-to-copy-directories.md - - name: "How to: Enumerate Directories and Files" + - name: 'How to: Enumerate Directories and Files' href: ../standard/io/how-to-enumerate-directories-and-files.md - - name: "How to: Read and Write to a Newly Created Data File" + - name: 'How to: Read and Write to a Newly Created Data File' href: ../standard/io/how-to-read-and-write-to-a-newly-created-data-file.md - - name: "How to: Open and Append to a Log File" + - name: 'How to: Open and Append to a Log File' href: ../standard/io/how-to-open-and-append-to-a-log-file.md - - name: "How to: Write Text to a File" + - name: 'How to: Write Text to a File' href: ../standard/io/how-to-write-text-to-a-file.md - - name: "How to: Read Text from a File" + - name: 'How to: Read Text from a File' href: ../standard/io/how-to-read-text-from-a-file.md - - name: "How to: Read Characters from a String" + - name: 'How to: Read Characters from a String' href: ../standard/io/how-to-read-characters-from-a-string.md - - name: "How to: Write Characters to a String" + - name: 'How to: Write Characters to a String' href: ../standard/io/how-to-write-characters-to-a-string.md - - name: "How to: Add or Remove Access Control List Entries" + - name: 'How to: Add or Remove Access Control List Entries' href: ../standard/io/how-to-add-or-remove-access-control-list-entries.md - - name: "How to: Compress and Extract Files" + - name: 'How to: Compress and Extract Files' href: ../standard/io/how-to-compress-and-extract-files.md - name: Composing Streams href: ../standard/io/composing-streams.md - - name: "How to: Convert Between .NET Framework Streams and Windows Runtime Streams" + - name: 'How to: Convert Between .NET Framework Streams and Windows Runtime Streams' href: ../standard/io/how-to-convert-between-dotnet-streams-and-winrt-streams.md - name: Asynchronous file I/O href: ../standard/io/asynchronous-file-i-o.md @@ -728,28 +707,28 @@ items: items: - name: Types of Isolation href: ../standard/io/types-of-isolation.md - - name: "How to: Obtain Stores for Isolated Storage" + - name: 'How to: Obtain Stores for Isolated Storage' href: ../standard/io/how-to-obtain-stores-for-isolated-storage.md - - name: "How to: Enumerate Stores for Isolated Storage" + - name: 'How to: Enumerate Stores for Isolated Storage' href: ../standard/io/how-to-enumerate-stores-for-isolated-storage.md - - name: "How to: Delete Stores in Isolated Storage" + - name: 'How to: Delete Stores in Isolated Storage' href: ../standard/io/how-to-delete-stores-in-isolated-storage.md - - name: "How to: Anticipate Out-of-Space Conditions with Isolated Storage" + - name: 'How to: Anticipate Out-of-Space Conditions with Isolated Storage' href: ../standard/io/how-to-anticipate-out-of-space-conditions-with-isolated-storage.md - - name: "How to: Create Files and Directories in Isolated Storage" + - name: 'How to: Create Files and Directories in Isolated Storage' href: ../standard/io/how-to-create-files-and-directories-in-isolated-storage.md - - name: "How to: Find Existing Files and Directories in Isolated Storage" + - name: 'How to: Find Existing Files and Directories in Isolated Storage' href: ../standard/io/how-to-find-existing-files-and-directories-in-isolated-storage.md - - name: "How to: Read and Write to Files in Isolated Storage" + - name: 'How to: Read and Write to Files in Isolated Storage' href: ../standard/io/how-to-read-and-write-to-files-in-isolated-storage.md - - name: "How to: Delete Files and Directories in Isolated Storage" + - name: 'How to: Delete Files and Directories in Isolated Storage' href: ../standard/io/how-to-delete-files-and-directories-in-isolated-storage.md - name: Pipes href: ../standard/io/pipe-operations.md items: - - name: "How to: Use Anonymous Pipes for Local Interprocess Communication" + - name: 'How to: Use Anonymous Pipes for Local Interprocess Communication' href: ../standard/io/how-to-use-anonymous-pipes-for-local-interprocess-communication.md - - name: "How to: Use Named Pipes for Network Interprocess Communication" + - name: 'How to: Use Named Pipes for Network Interprocess Communication' href: ../standard/io/how-to-use-named-pipes-for-network-interprocess-communication.md - name: Pipelines href: ../standard/io/pipelines.md @@ -762,140 +741,140 @@ items: - name: Dependency injection items: - name: Overview - href: ../core/extensions/dependency-injection.md displayName: dependency injection,di,ioc,ioc container,dependency container,inversion of control + href: ../core/extensions/dependency-injection.md - name: Use dependency injection - href: ../core/extensions/dependency-injection-usage.md displayName: use dependency injection,di,di examples,ioc,ioc container,dependency container,inversion of control + href: ../core/extensions/dependency-injection-usage.md - name: Dependency injection guidelines - href: ../core/extensions/dependency-injection-guidelines.md displayName: dependency injection best practices,guidelines,di,ioc,ioc container,dependency container,inversion of control + href: ../core/extensions/dependency-injection-guidelines.md - name: Configuration items: - name: Overview - href: ../core/extensions/configuration.md displayName: configuration,config,configuration sources,config sources + href: ../core/extensions/configuration.md - name: Configuration providers - href: ../core/extensions/configuration-providers.md displayName: configuration providers,config providers + href: ../core/extensions/configuration-providers.md - name: Implement a custom configuration provider - href: ../core/extensions/custom-configuration-provider.md displayName: custom configuration,custom config,custom configuration provider,custom config provider + href: ../core/extensions/custom-configuration-provider.md - name: Options pattern - href: ../core/extensions/options.md displayName: options pattern,options,configuration options,config options + href: ../core/extensions/options.md - name: Options pattern guidance for library authors - href: ../core/extensions/options-library-authors.md displayName: options pattern guidance,options guidance,configuration options guidance,config options guidance + href: ../core/extensions/options-library-authors.md - name: Logging items: - name: Overview - href: ../core/extensions/logging.md displayName: logging,logger,log,loggers + href: ../core/extensions/logging.md - name: Logging providers - href: ../core/extensions/logging-providers.md displayName: logging providers,log providers + href: ../core/extensions/logging-providers.md - name: Compile-time logging source generation - href: ../core/extensions/logger-message-generator.md displayName: LoggerMessage,LoggerMessageAttribute,source generator,compile-time generation + href: ../core/extensions/logger-message-generator.md - name: Implement a custom logging provider - href: ../core/extensions/custom-logging-provider.md displayName: custom logging,custom log,custom logging provider,custom log provider + href: ../core/extensions/custom-logging-provider.md - name: High-performance logging - href: ../core/extensions/high-performance-logging.md displayName: high-performance logging,high-performance log,high-performance logging provider,high-performance log provider + href: ../core/extensions/high-performance-logging.md - name: Console log formatting - href: ../core/extensions/console-log-formatter.md displayName: console log formatting,console log formatter,console log formatting provider,console log formatter provider + href: ../core/extensions/console-log-formatter.md - name: HostBuilder (generic host) href: ../core/extensions/generic-host.md - name: Networking items: - name: Network programming - href: networking/overview.md displayName: networking,sockets,socket,socket programming,socket client,socket server,socket client server,socket client-server,socket client-server,socket client/server,socket client/server,socket client-serve + href: networking/overview.md - name: Network availability - href: networking/network-info.md displayName: network availability,network info,network information,network availability info,network availability information,network info availability,network information availability,network availability info + href: networking/network-info.md - name: IPv6 overview - href: networking/ipv6-overview.md displayName: ipv6,ipv + href: networking/ipv6-overview.md - name: Telemetry - href: networking/networking-telemetry.md displayName: networking telemetry + href: networking/networking-telemetry.md - name: HTTP items: - name: HTTP support - href: networking/http/http-overview.md displayName: networking,http,web services,httpclient + href: networking/http/http-overview.md - name: HTTP client guidelines - href: networking/http/httpclient-guidelines.md displayName: networking, httpclient + href: networking/http/httpclient-guidelines.md - name: Make HTTP requests - href: networking/http/httpclient.md displayName: networking,http,web services,client + href: networking/http/httpclient.md - name: IHttpClientFactory - href: ../core/extensions/httpclient-factory.md displayName: networking,httpclient,http,dependency injection,client,factory,named client,named httpclient,typed client,typed httpclient + href: ../core/extensions/httpclient-factory.md - name: HTTP/3 with .NET - href: ../core/extensions/httpclient-http3.md displayName: networking,http,http3,http/3,http3 with .net,http/3 with .net + href: ../core/extensions/httpclient-http3.md - name: Rate limit an HTTP handler - href: ../core/extensions/http-ratelimiter.md displayName: networking,http,rate limit,rate limiting,rate limit http,rate limiting http,rate limit http handler,rate limiting http handler + href: ../core/extensions/http-ratelimiter.md - name: Sockets items: - name: Sockets support - href: networking/sockets/sockets-overview.md displayName: networking,sockets,socket,socket programming,socket client,socket server + href: networking/sockets/sockets-overview.md - name: Use Sockets to send and receive data over TCP - href: networking/sockets/socket-services.md displayName: networking,sockets,socket,socket programming,socket client,socket server + href: networking/sockets/socket-services.md - name: Use TcpClient and TcpListener - href: networking/sockets/tcp-classes.md displayName: networking,tcp,tcp listener,tcp client + href: networking/sockets/tcp-classes.md - name: WebSockets items: - name: WebSockets support - href: networking/websockets.md displayName: websockets,websocket,websocket programming,websocket client,websocket server + href: networking/websockets.md - name: Security items: - - name: TLS/SSL best practices - href: ../core/extensions/sslstream-best-practices.md - displayName: tls,ssl,sslstream,sslstream best practices,tls best practices,ssl best practices - - name: Troubleshoot SslStream authentication issues - href: ../core/extensions/sslstream-troubleshooting.md - displayName: tls,ssl,sslstream,sslstream troubleshooting,tls troubleshooting,ssl troubleshooting - - name: Migrate from .NET Framework to .NET - href: ../core/extensions/sslstream-migration-from-framework.md + - name: TLS/SSL best practices + displayName: tls,ssl,sslstream,sslstream best practices,tls best practices,ssl best practices + href: ../core/extensions/sslstream-best-practices.md + - name: Troubleshoot SslStream authentication issues + displayName: tls,ssl,sslstream,sslstream troubleshooting,tls troubleshooting,ssl troubleshooting + href: ../core/extensions/sslstream-troubleshooting.md + - name: Migrate from .NET Framework to .NET + href: ../core/extensions/sslstream-migration-from-framework.md - name: QUIC items: - name: QUIC support href: networking/quic/quic-overview.md - name: File globbing - href: ../core/extensions/file-globbing.md displayName: file globbing,globbing,globbing patterns,globbing pattern,globbing + href: ../core/extensions/file-globbing.md - name: Primitives library - href: ../core/extensions/primitives.md displayName: primitives,primitive types,ichangetoken,change notifications,string tokenizers,StringSegment,StringTokenizer,StringValues + href: ../core/extensions/primitives.md - name: Globalization and localization items: - name: Overview - href: ../core/extensions/globalization-and-localization.md displayName: globalization,localization,culture,localization and globalization + href: ../core/extensions/globalization-and-localization.md - name: Globalization - href: ../core/extensions/globalization.md displayName: globalization,culture + href: ../core/extensions/globalization.md - name: Globalization and ICU - href: ../core/extensions/globalization-icu.md displayName: globalization,icu,culture + href: ../core/extensions/globalization-icu.md - name: Localizability review - href: ../core/extensions/localizability-review.md displayName: localizability,localization,localization review,localizability review + href: ../core/extensions/localizability-review.md - name: Localization - href: ../core/extensions/localization.md displayName: localization,localization review,localizability review + href: ../core/extensions/localization.md - name: Culture-insensitive string operations items: - name: Overview @@ -938,8 +917,8 @@ items: - name: Create a Windows Service using BackgroundService href: ../core/extensions/windows-service.md - name: Create a Windows Service installer - href: ../core/extensions/windows-service-with-installer.md displayName: msi,windows service installer,setup.exe + href: ../core/extensions/windows-service-with-installer.md - name: Implement the IHostedService interface href: ../core/extensions/timer-service.md - name: Deploy a Worker Service to Azure @@ -956,76 +935,76 @@ items: href: ../standard/managed-execution-process.md - name: Assemblies items: + - name: Overview + displayName: assembly,assemblies + href: ../standard/assembly/index.md + - name: Assembly contents + href: ../standard/assembly/contents.md + - name: Manifest + href: ../standard/assembly/manifest.md + - name: Security considerations + href: ../standard/assembly/security-considerations.md + - name: Versioning + href: ../standard/assembly/versioning.md + - name: Side-by-side execution + href: ../standard/assembly/side-by-side-execution.md + - name: Assembly file format + href: ../standard/assembly/file-format.md + - name: Unloadability in .NET Core + href: ../standard/assembly/unloadability.md + - name: Learn about reference assemblies + href: ../standard/assembly/reference-assemblies.md + - name: Resolve assembly loads + href: ../standard/assembly/resolve-loads.md + - name: Create assemblies + href: ../standard/assembly/create.md + - name: Assembly names + href: ../standard/assembly/names.md + - name: Find an assembly's fully qualified name + href: ../standard/assembly/find-fully-qualified-name.md + - name: Assembly location + href: ../standard/assembly/location.md + - name: Set assembly attributes + href: ../standard/assembly/set-attributes.md + - name: Strong-named assemblies + items: - name: Overview - displayName: assembly,assemblies - href: ../standard/assembly/index.md - - name: Assembly contents - href: ../standard/assembly/contents.md - - name: Manifest - href: ../standard/assembly/manifest.md - - name: Security considerations - href: ../standard/assembly/security-considerations.md - - name: Versioning - href: ../standard/assembly/versioning.md - - name: Side-by-side execution - href: ../standard/assembly/side-by-side-execution.md - - name: Assembly file format - href: ../standard/assembly/file-format.md - - name: Unloadability in .NET Core - href: ../standard/assembly/unloadability.md - - name: Learn about reference assemblies - href: ../standard/assembly/reference-assemblies.md - - name: Resolve assembly loads - href: ../standard/assembly/resolve-loads.md - - name: Create assemblies - href: ../standard/assembly/create.md - - name: Assembly names - href: ../standard/assembly/names.md - - name: Find an assembly's fully qualified name - href: ../standard/assembly/find-fully-qualified-name.md - - name: Assembly location - href: ../standard/assembly/location.md - - name: Set assembly attributes - href: ../standard/assembly/set-attributes.md - - name: Strong-named assemblies - items: - - name: Overview - href: ../standard/assembly/strong-named.md - - name: Create and use strong-named assemblies - href: ../standard/assembly/create-use-strong-named.md - - name: Create a public-private key pair - href: ../standard/assembly/create-public-private-key-pair.md - - name: Sign an assembly with a strong name - href: ../standard/assembly/sign-strong-name.md - - name: Enhanced strong naming - href: ../standard/assembly/enhanced-strong-naming.md - - name: Reference a strong-named assembly - href: ../standard/assembly/reference-strong-named.md - - name: Disable strong-name bypass - href: ../standard/assembly/disable-strong-name-bypass-feature.md - - name: Delay-sign an assembly - href: ../standard/assembly/delay-sign.md - - name: View assembly contents - href: ../standard/assembly/view-contents.md - - name: Type forwarding in the CLR - href: ../standard/assembly/type-forwarding.md - - name: Friend assemblies - items: - - name: Overview - displayName: friend assembly,friend assemblies - href: ../standard/assembly/friend.md - - name: Create unsigned friend assemblies - href: ../standard/assembly/create-unsigned-friend.md - - name: Create signed friend assemblies - href: ../standard/assembly/create-signed-friend.md - - name: Determine if a file is an assembly - href: ../standard/assembly/identify.md - - name: Load and unload assemblies - href: ../standard/assembly/load-unload.md - - name: Embed types from managed assemblies in Visual Studio - href: ../standard/assembly/embed-types-visual-studio.md - - name: Inspect assembly contents using MetadataLoadContext - href: ../standard/assembly/inspect-contents-using-metadataloadcontext.md + href: ../standard/assembly/strong-named.md + - name: Create and use strong-named assemblies + href: ../standard/assembly/create-use-strong-named.md + - name: Create a public-private key pair + href: ../standard/assembly/create-public-private-key-pair.md + - name: Sign an assembly with a strong name + href: ../standard/assembly/sign-strong-name.md + - name: Enhanced strong naming + href: ../standard/assembly/enhanced-strong-naming.md + - name: Reference a strong-named assembly + href: ../standard/assembly/reference-strong-named.md + - name: Disable strong-name bypass + href: ../standard/assembly/disable-strong-name-bypass-feature.md + - name: Delay-sign an assembly + href: ../standard/assembly/delay-sign.md + - name: View assembly contents + href: ../standard/assembly/view-contents.md + - name: Type forwarding in the CLR + href: ../standard/assembly/type-forwarding.md + - name: Friend assemblies + items: + - name: Overview + displayName: friend assembly,friend assemblies + href: ../standard/assembly/friend.md + - name: Create unsigned friend assemblies + href: ../standard/assembly/create-unsigned-friend.md + - name: Create signed friend assemblies + href: ../standard/assembly/create-signed-friend.md + - name: Determine if a file is an assembly + href: ../standard/assembly/identify.md + - name: Load and unload assemblies + href: ../standard/assembly/load-unload.md + - name: Embed types from managed assemblies in Visual Studio + href: ../standard/assembly/embed-types-visual-studio.md + - name: Inspect assembly contents using MetadataLoadContext + href: ../standard/assembly/inspect-contents-using-metadataloadcontext.md - name: Metadata and self-describing components href: ../standard/metadata-and-self-describing-components.md - name: Dependency loading diff --git a/docs/standard/serialization/basic-serialization.md b/docs/standard/serialization/basic-serialization.md deleted file mode 100644 index 1f975abe7680b..0000000000000 --- a/docs/standard/serialization/basic-serialization.md +++ /dev/null @@ -1,93 +0,0 @@ ---- -title: "Basic serialization" -description: This article shows you how to make a class serializable with the SerializableAttribute and includes examples of serialization and deserialization. -ms.date: "03/30/2017" -helpviewer_keywords: - - "binary serialization, basic serialization" - - "serialization, basic serialization" -ms.assetid: d899d43c-335a-433e-a589-cd187192984f -dev_langs: - - "CSharp" ---- -# Basic serialization - -[!INCLUDE [binary-serialization-warning](../../../includes/binary-serialization-warning.md)] - -The easiest way to make a class binary serializable is to mark it with the as follows. - -```csharp -[Serializable] -public class MyObject { - public int n1 = 0; - public int n2 = 0; - public String str = null; -} -``` - -The following code example shows how an instance of this class can be serialized to a file. - -```csharp -MyObject obj = new MyObject(); -obj.n1 = 1; -obj.n2 = 24; -obj.str = "Some String"; -IFormatter formatter = new BinaryFormatter(); -Stream stream = new FileStream("MyFile.bin", FileMode.Create, FileAccess.Write, FileShare.None); -formatter.Serialize(stream, obj); -stream.Close(); -``` - -This example uses a binary formatter to do the serialization. All you need to do is create an instance of the stream and the formatter you intend to use, and then call the **Serialize** method on the formatter. The stream and the object to serialize are provided as parameters to this call. Although it is not explicitly demonstrated in this example, all member variables of a class will be serialized—even variables marked as private. In this aspect, binary serialization differs from the class, which only serializes public fields. For information on excluding member variables from binary serialization, see [Selective Serialization](selective-serialization.md). - -Restoring the object back to its former state is just as easy. First, create a stream for reading and a , and then instruct the formatter to deserialize the object. The code example below shows how this is done. - -```csharp -IFormatter formatter = new BinaryFormatter(); -Stream stream = new FileStream("MyFile.bin", FileMode.Open, FileAccess.Read, FileShare.Read); -MyObject obj = (MyObject) formatter.Deserialize(stream); -stream.Close(); - -// Here's the proof. -Console.WriteLine("n1: {0}", obj.n1); -Console.WriteLine("n2: {0}", obj.n2); -Console.WriteLine("str: {0}", obj.str); -``` - -The used in the preceding code is efficient and produces a compact byte stream. All objects serialized with this formatter can also be deserialized with it, which makes it an ideal tool for serializing objects that will be deserialized on .NET. It's important to note that constructors are not called when an object is deserialized. This constraint is placed on deserialization for performance reasons. However, this violates some of the usual contracts the runtime makes with the object writer, and developers should ensure that they understand the ramifications when marking an object as serializable. - -If portability is a requirement, use the instead. Simply replace the `BinaryFormatter` in the previous code with `SoapFormatter`, and call `Serialize` and `Deserialize` as before. This formatter produces the following output for the example used previously. - -```xml - - - - - 1 - 24 - Some String - - - -``` - -It's important to note that the [Serializable](xref:System.SerializableAttribute) attribute cannot be inherited. If you derive a new class from `MyObject`, the new class must be marked with the attribute as well, or it cannot be serialized. For example, when you attempt to serialize an instance of the following class, you'll get a informing you that the `MyStuff` type is not marked as serializable. - -```csharp -public class MyStuff : MyObject -{ - public int n3; -} -``` - - Using the [Serializable](xref:System.SerializableAttribute) attribute is convenient, but it has limitations as previously demonstrated. Refer to the [Serialization guidelines](serialization-guidelines.md) for information about when you should mark a class for binary serialization. Binary serialization cannot be added to a class after it's been compiled. - -## See also - -- [Binary Serialization](binary-serialization.md) -- [XML and SOAP Serialization](xml-and-soap-serialization.md) diff --git a/docs/standard/serialization/binary-serialization.md b/docs/standard/serialization/binary-serialization.md deleted file mode 100644 index e485e4ed08cd7..0000000000000 --- a/docs/standard/serialization/binary-serialization.md +++ /dev/null @@ -1,346 +0,0 @@ ---- -title: "Binary serialization" -description: This article describes binary serialization and types for which .NET Core supports it. Be aware of the dangers of binary serialization and alternatives to it. -ms.date: 03/18/2022 -helpviewer_keywords: - - "binary serialization" - - "serialization, about serialization" - - "deserialization" - - "binary serialization, about serialization" - - "binary serialization, .net core serialization" - - "serialization, cross-framework" -ms.assetid: 2b1ea3be-1152-4032-b2b3-07794054c405 -author: "ViktorHofer" ---- -# Binary serialization - -Serialization is the process of storing the state of an object to a storage medium. In binary serialization, the public and private fields of the object and the name of the class, including the assembly containing the class, are converted to a stream of bytes, which is then written to a data stream. When the object is subsequently deserialized, an exact clone of the original object is created. - -When implementing a serialization mechanism in an object-oriented environment, you often need to make tradeoffs between ease of use and flexibility. The process can be automated to a large extent, provided you are given sufficient control over the process. For example, situations may arise where simple binary serialization is not sufficient, or there might be a specific reason to decide which fields in a class need to be serialized. The following sections examine the robust serialization mechanism provided with .NET and highlight a number of important features that allow you to customize the process to meet your needs. - -> [!NOTE] -> The state of a UTF-8 or UTF-7 encoded object is not preserved if the object is serialized and deserialized using different .NET versions. - -[!INCLUDE [binary-serialization-warning](../../../includes/binary-serialization-warning.md)] - -Binary serialization allows modifying private members inside an object and therefore changing the state of it. Because of this, other serialization frameworks, like , that operate on the public API surface are recommended. - -## .NET Core - -.NET Core supports binary serialization for a subset of types. You can see the list of supported types in the [Serializable types](#serializable-types) section that follows. The listed types are guaranteed to be serializable between .NET Framework 4.5.1 and later versions and between .NET Core 2.0 and later versions. Other .NET implementations, such as Mono, aren't officially supported but should also work. - -### Serializable types - -> [!div class="mx-tdBreakAll"] -> | Type | Notes | -> | - | - | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | | -> | | | -> | | Starting in .NET Core 2.0.4. | -> | | | -> | | Starting in .NET Core 2.0.4. | -> | | | -> | | | -> | | Starting in .NET Core 2.0.4. | -> | | | -> | | | -> | | | -> | | | -> | | | -> | | | -> | | | -> | | | -> | | | -> | | Starting in .NET Core 2.0.4. | -> | | | -> | | | -> | | | -> | | | -> | | | -> | | | -> | | | -> | | | -> | | | -> | | | -> | | | -> | | | -> | | | -> | | | -> | | | -> | | | -> | | | -> | | | -> | | | -> | | | -> | | | -> | | | -> | | | -> | `System.Collections.Generic.NonRandomizedStringEqualityComparer` | Starting in .NET Core 2.0.4. | -> | | | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4.
Serialization from .NET Framework to .NET Core is not supported. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.2 and later versions. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | | -> | | If you set `RemotingFormat` to `SerializationFormat.Binary`, it can only be exchanged with .NET Core 2.1 and later versions. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4.
Serialization from .NET Framework to .NET Core is not supported | -> | | Starting in .NET Core 2.0.4. | -> | | | -> | | | -> | | | -> | | | -> | | | -> | | | -> | | | -> | | | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | | -> | | | -> | | | -> | `System.Diagnostics.Contracts.ContractException` | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | | -> | | Starting in .NET Core 3.0 | -> | | | -> | | Starting in .NET Core 3.0 | -> | | Starting in .NET Core 3.0 | -> | | Starting in .NET Core 3.0 | -> | | | -> | | | -> | | | -> | | | -> | | | -> | | | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | | -> | | Starting in .NET Core 2.0.6. | -> | | | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | | -> | | Starting in .NET Core 2.0.4. | -> | | | -> | | | -> | `System.IO.Compression.ZLibException` | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | | -> | | | -> | | | -> | | | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | | -> | | | -> | | | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | | -> | | | -> | | | -> | | | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4.
Serialization from .NET Framework to .NET Core is not supported. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | `System.Security.Cryptography.Xml.CryptoSignedXmlRecursionException` | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4.
Limited serialization data. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | | -> | | Starting in .NET Core 2.0.4. | -> | | | -> | | | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | | -> | | | -> | | | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | | -> | | | -> | | | -> | | | -> | | Starting in .NET Core 2.0.4. | -> | | | -> | | Starting in .NET Core 2.0.4. | -> | | Not serializable in .NET Framework 4.7 and earlier versions. | -> | | | -> | | | -> | | | -> | | | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | -> | | Starting in .NET Core 2.0.4. | - -## See also - -- \ -Contains classes that can be used for serializing and deserializing objects. - -- [XML and SOAP Serialization](xml-and-soap-serialization.md)\ -Describes the XML serialization mechanism that is included with the common language runtime. diff --git a/docs/standard/serialization/binaryformatter-event-source.md b/docs/standard/serialization/binaryformatter-event-source.md deleted file mode 100644 index 11855eba1c46f..0000000000000 --- a/docs/standard/serialization/binaryformatter-event-source.md +++ /dev/null @@ -1,110 +0,0 @@ ---- -title: BinaryFormatter event source -description: Learn how to use the BinaryFormatter event source to log when serialization or deserialization is occurring. -ms.date: 12/03/2020 -ms.author: levib -author: GrabYourPitchforks -ms.topic: reference ---- -# BinaryFormatter event source - -Starting with .NET 5, includes a built-in that gives you visibility into when an object serialization or deserialization is occurring. Apps can use -derived types to listen for these notifications and log them. - -This functionality is not a substitute for a or an and can't be used to modify the data being serialized or deserialized. Rather, this eventing system is intended to provide insight into the types being serialized or deserialized. It can also be used to detect unintended calls into the `BinaryFormatter` infrastructure, such as calls originating from third-party library code. - -## Description of events - -The `BinaryFormatter` event source has the well-known name `System.Runtime.Serialization.Formatters.Binary.BinaryFormatterEventSource`. Listeners can subscribe to six events. - -### SerializationStart event (id = `10`) - -Raised when has been called and has started the serialization process. This event is paired with the `SerializationEnd` event. The `SerializationStart` event can be called recursively if an object calls `BinaryFormatter.Serialize` within its own serialization routine. - -This event doesn't contain a payload. - -### SerializationEnd event (id = `11`) - -Raised when `BinaryFormatter.Serialize` has completed its work. Each occurrence of `SerializationEnd` denotes the completion of the last unpaired `SerializationStart` event. - -This event doesn't contain a payload. - -### SerializingObject event (id = `12`) - -Raised when `BinaryFormatter.Serialize` is in the process of serializing a non-primitive type. The `BinaryFormatter` infrastructure special-cases certain types (such as `string` and `int`) and doesn't raise this event when these types are encountered. This event is raised for user-defined types and other types that `BinaryFormatter` doesn't natively understand. - -This event may be raised zero or more times between `SerializationStart` and `SerializationEnd` events. - -This event contains a payload with one argument: - -* `typeName` (`string`): The assembly-qualified name (see ) of the type being serialized. - -### DeserializationStart event (id = `20`) - -Raised when has been called and has started the deserialization process. This event is paired with the `DeserializationEnd` event. The `DeserializationStart` event can be called recursively if an object calls `BinaryFormatter.Deserialize` within its own deserialization routine. - -This event doesn't contain a payload. - -### DeserializationEnd event (id = `21`) - -Raised when `BinaryFormatter.Deserialize` has completed its work. Each occurrence of `DeserializationEnd` denotes the completion of the last unpaired `DeserializationStart` event. - -This event doesn't contain a payload. - -### DeserializingObject event (id = `22`) - -Raised when `BinaryFormatter.Deserialize` is in the process of deserializing a non-primitive type. The `BinaryFormatter` infrastructure special-cases certain types (such as `string` and `int`) and doesn't raise this event when these types are encountered. This event is raised for user-defined types and other types that `BinaryFormatter` doesn't natively understand. - -This event may be raised zero or more times between `DeserializationStart` and `DeserializationEnd` events. - -This event contains a payload with one argument. - -* `typeName` (`string`): The assembly-qualified name (see ) of the type being deserialized. - -### \[Advanced\] Subscribing to a subset of notifications - -Listeners who wish to subscribe to only a subset of notifications can choose which keywords to enable. - -* `Serialization` = `(EventKeywords)1`: Raises the `SerializationStart`, `SerializationEnd`, and `SerializingObject` events. -* `Deserialization` = `(EventKeywords)2`: Raises the `DeserializationStart`, `DeserializationEnd`, and `DeserializingObject` events. - -If no keyword filters are provided during `EventListener` registration, all events are raised. - -For more information, see . - -## Sample code - -The following code: - -- creates an `EventListener`-derived type that writes to `System.Console`, -- subscribes that listener to `BinaryFormatter`-produced notifications, -- serializes and deserializes a simple object graph using `BinaryFormatter`, and -- analyzes the events that have been raised. - -:::code language="csharp" source="snippets/binaryformatter-event-source/csharp/Program.cs"::: - -The preceding code produces output similar to the following example: - -```output -Event SerializationStart (id=10) received. -Event SerializingObject (id=12) received. -typeName = BinaryFormatterEventSample.Person, BinaryFormatterEventSample, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -Event SerializingObject (id=12) received. -typeName = BinaryFormatterEventSample.Book, BinaryFormatterEventSample, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -Event SerializationStop (id=11) received. -Event DeserializationStart (id=20) received. -Event DeserializingObject (id=22) received. -typeName = BinaryFormatterEventSample.Person, BinaryFormatterEventSample, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -Event DeserializingObject (id=22) received. -typeName = BinaryFormatterEventSample.Book, BinaryFormatterEventSample, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null -Event DeserializationStop (id=21) received. -Rehydrated person Logan Edwards -Favorite book: A Tale of Two Cities by Charles Dickens, list price 10.25 -``` - -In this sample, the console-based `EventListener` logs that serialization starts, instances of `Person` and `Book` are serialized, and then serialization completes. Similarly, once deserialization has started, instances of `Person` and `Book` are deserialized, and then deserialization completes. - -The app then prints the values contained in the deserialized `Person` to demonstrate that the object did in fact serialize and deserialize properly. - -## See also - -For more information on using `EventListener` to receive `EventSource`-based notifications, see [the `EventListener` class](xref:System.Diagnostics.Tracing.EventListener). diff --git a/docs/standard/serialization/custom-serialization.md b/docs/standard/serialization/custom-serialization.md deleted file mode 100644 index 5c47b69c38bdf..0000000000000 --- a/docs/standard/serialization/custom-serialization.md +++ /dev/null @@ -1,175 +0,0 @@ ---- -title: "Custom binary serialization" -description: Custom serialization is controlling the serialization and deserialization of a type. Controlling serialization can ensure serialization compatibility. -ms.date: 04/21/2022 -dev_langs: - - "csharp" - - "vb" -helpviewer_keywords: - - "binary serialization, custom serialization" - - "custom serialization" - - "binary serialization, controlling" - - "OptionalFieldAttribute class, custom serialization" - - "ISerializable interface, custom serialization" - - "OnDeserializingAttribute class, custom serialization" - - "OnSerializedAttribute class, custom serialization" - - "serialization, custom serialization" - - "serialization, controlling" - - "OnDeserializedAttribute class, custom serialization" - - "OnSerializingAttribute class, custom serialization" -ms.assetid: 12ed422d-5280-49b8-9b71-a2ed129c0384 ---- -# Custom binary serialization - -Custom serialization is the process of controlling the serialization and deserialization of a type. By controlling serialization, it's possible to ensure serialization compatibility, which is the ability to serialize and deserialize between versions of a type without breaking the core functionality of the type. For example, in the first version of a type, there may be only two fields. In the next version of a type, several more fields are added. Yet the second version of an application must be able to serialize and deserialize both types. The following sections describe how to control serialization. - -[!INCLUDE [binary-serialization-warning](../../../includes/binary-serialization-warning.md)] - -> [!IMPORTANT] -> In versions previous to .NET Framework 4.0, serialization of custom user data in a partially trusted assembly was accomplished using `GetObjectData`. In .NET Framework versions 4.0 - 4.8, that method is marked with the attribute, which prevents execution in partially trusted assemblies. To work around this condition, implement the interface. - -## Run custom methods during and after serialization - -The recommended way to run custom methods during and after binary serialization is to apply the following attributes to methods that are used to correct data during and after serialization: - -- - -- - -- - -- - - These attributes allow the type to participate in any one of, or all four of the phases, of the serialization and deserialization processes. The attributes specify the methods of the type that should be invoked during each phase. The methods do not access the serialization stream but instead allow you to alter the object before and after serialization, or before and after deserialization. The attributes can be applied at all levels of the type inheritance hierarchy, and each method is called in the hierarchy from the base to the most derived. This mechanism avoids the complexity and any resulting issues of implementing the interface by giving the responsibility for serialization and deserialization to the most derived implementation. Additionally, this mechanism allows the formatters to ignore the population of fields and retrieval from the serialization stream. For details and examples of controlling serialization and deserialization, click any of the previous links. - - In addition, when adding a new field to an existing serializable type, apply the attribute to the field. The and the ignores the absence of the field when a stream that is missing the new field is processed. - -## Implement the ISerializable interface - - The other way to control binary serialization is to implement the interface on an object. Note, however, that the method in the previous section supersedes this method to control serialization. - - In addition, you should not use default serialization on a class that is marked with the [Serializable](xref:System.SerializableAttribute) attribute and has declarative or imperative security at the class level or on its constructors. Instead, these classes should always implement the interface. - - Implementing involves implementing the `GetObjectData` method and a special constructor that's used when the object is deserialized. The following sample code shows how to implement on the `MyObject` class from a previous section. - -```csharp -[Serializable] -public class MyObject : ISerializable -{ - public int n1; - public int n2; - public String str; - - public MyObject() - { - } - - protected MyObject(SerializationInfo info, StreamingContext context) - { - n1 = info.GetInt32("i"); - n2 = info.GetInt32("j"); - str = info.GetString("k"); - } - - public virtual void GetObjectData(SerializationInfo info, StreamingContext context) - { - info.AddValue("i", n1); - info.AddValue("j", n2); - info.AddValue("k", str); - } -} -``` - -```vb - _ -Public Class MyObject - Implements ISerializable - Public n1 As Integer - Public n2 As Integer - Public str As String - - Public Sub New() - End Sub - - Protected Sub New(ByVal info As SerializationInfo, ByVal context As StreamingContext) - n1 = info.GetInt32("i") - n2 = info.GetInt32("j") - str = info.GetString("k") - End Sub 'New - - Public Overridable Sub GetObjectData(ByVal info As SerializationInfo, ByVal context As StreamingContext) - info.AddValue("i", n1) - info.AddValue("j", n2) - info.AddValue("k", str) - End Sub -End Class -``` - - When `GetObjectData` is called during serialization, you are responsible for populating the provided with the method call. Add the variables to be serialized as name and value pairs. Any text can be used as the name. You have the freedom to decide which member variables are added to the , provided that sufficient data is serialized to restore the object during deserialization. Derived classes should call the `GetObjectData` method on the base object if the latter implements . - - It's important to stress that when is added to a class, you must implement both `GetObjectData` and the special constructor. The compiler warns you if `GetObjectData` is missing. However, because it is impossible to enforce the implementation of a constructor, no warning is provided if the constructor is absent, and an exception is thrown when an attempt is made to deserialize a class without the constructor. - - The current design was favored above a method to get around potential security and versioning problems. For example, a `SetObjectData` method must be public if it is defined as part of an interface; thus users must write code to defend against having the `SetObjectData` method called multiple times. Otherwise, a malicious application that calls the `SetObjectData` method on an object in the process of executing an operation can cause potential problems. - - During deserialization, is passed to the class using the constructor provided for this purpose. Any visibility constraints placed on the constructor are ignored when the object is deserialized; so you can mark the class as public, protected, internal, or private. However, it is a best practice to make the constructor protected unless the class is sealed, in which case the constructor should be marked private. The constructor should also perform thorough input validation. - - To restore the state of the object, simply retrieve the values of the variables from using the names used during serialization. If the base class implements , the base constructor should be called to allow the base object to restore its variables. - - When you derive a new class from one that implements , the derived class must implement both the constructor as well as the `GetObjectData` method if it has variables that need to be serialized. The following code example shows how this is done using the `MyObject` class shown previously. - -```csharp -[Serializable] -public class ObjectTwo : MyObject -{ - public int num; - - public ObjectTwo() - : base() - { - } - - protected ObjectTwo(SerializationInfo si, StreamingContext context) - : base(si, context) - { - num = si.GetInt32("num"); - } - - public override void GetObjectData(SerializationInfo si, StreamingContext context) - { - base.GetObjectData(si,context); - si.AddValue("num", num); - } -} -``` - -```vb - _ -Public Class ObjectTwo - Inherits MyObject - Public num As Integer - - Public Sub New() - - End Sub - - Protected Sub New(ByVal si As SerializationInfo, _ - ByVal context As StreamingContext) - MyBase.New(si, context) - num = si.GetInt32("num") - End Sub - - Public Overrides Sub GetObjectData(ByVal si As SerializationInfo, ByVal context As StreamingContext) - MyBase.GetObjectData(si, context) - si.AddValue("num", num) - End Sub -End Class -``` - - Don't forget to call the base class in the deserialization constructor. If this isn't done, the constructor on the base class is never called, and the object is not fully constructed after deserialization. - - Objects are reconstructed from the inside out; and calling methods during deserialization can have undesirable side effects, because the methods called might refer to object references that have not been deserialized by the time the call is made. If the class being deserialized implements the , the method is automatically called when the entire object graph has been deserialized. At this point, all the child objects referenced have been fully restored. A hash table is a typical example of a class that is difficult to deserialize without using the event listener. It is easy to retrieve the key and value pairs during deserialization, but adding these objects back to the hash table can cause problems, because there is no guarantee that classes that derived from the hash table have been deserialized. Calling methods on a hash table at this stage is therefore not advisable. - -## See also - -- [Binary Serialization](binary-serialization.md) -- [XML and SOAP Serialization](xml-and-soap-serialization.md) diff --git a/docs/standard/serialization/how-to-chunk-serialized-data.md b/docs/standard/serialization/how-to-chunk-serialized-data.md deleted file mode 100644 index 1a4e9a29df878..0000000000000 --- a/docs/standard/serialization/how-to-chunk-serialized-data.md +++ /dev/null @@ -1,59 +0,0 @@ ---- -title: "How to: chunk serialized data" -description: You can chunk data to avoid problems with large datasets. Implement the IXmlSerializable interface to control serialization and deserialization. -ms.date: "03/30/2017" -dev_langs: - - "csharp" - - "vb" -helpviewer_keywords: - - "chunking serialized data" - - "data chunking" - - "binary serialization, chunking data" - - "large data set chunking" - - "serialization, chunking data" - - "serialization, examples" - - "binary serialization, examples" -ms.assetid: 22f1b818-7e0d-428a-8680-f17d6ebdd185 ---- -# How to: chunk serialized data - -[!INCLUDE [binary-serialization-warning](../../../includes/binary-serialization-warning.md)] - -Two issues that occur when sending large data sets in Web service messages are: - -1. A large working set (memory) due to buffering by the serialization engine. - -2. Inordinate bandwidth consumption due to 33 percent inflation after Base64 encoding. - - To solve these problems, implement the interface to control the serialization and deserialization. Specifically, implement the and methods to chunk the data. - -### To implement server-side chunking - -1. On the server machine, the Web method must turn off ASP.NET buffering and return a type that implements . - -2. The type that implements chunks the data in the method. - -### To implement client-side processing - -1. Alter the Web method on the client proxy to return the type that implements . You can use a to do this automatically, but this isn't shown here. - -2. Implement the method to read the chunked data stream and write the bytes to disk. This implementation also raises progress events that can be used by a graphic control, such as a progress bar. - -## Example - -The following code example shows the Web method on the client that turns off ASP.NET buffering. It also shows the client-side implementation of the interface that chunks the data in the method. - -[!code-csharp[HowToChunkSerializedData#1](../../../samples/snippets/csharp/VS_Snippets_Remoting/HowToChunkSerializedData/CS/SerializationChunk.cs#1)] -[!code-vb[HowToChunkSerializedData#1](../../../samples/snippets/visualbasic/VS_Snippets_Remoting/HowToChunkSerializedData/VB/SerializationChunk.vb#1)] -[!code-csharp[HowToChunkSerializedData#2](../../../samples/snippets/csharp/VS_Snippets_Remoting/HowToChunkSerializedData/CS/SerializationChunk.cs#2)] -[!code-vb[HowToChunkSerializedData#2](../../../samples/snippets/visualbasic/VS_Snippets_Remoting/HowToChunkSerializedData/VB/SerializationChunk.vb#2)] -[!code-csharp[HowToChunkSerializedData#3](../../../samples/snippets/csharp/VS_Snippets_Remoting/HowToChunkSerializedData/CS/SerializationChunk.cs#3)] -[!code-vb[HowToChunkSerializedData#3](../../../samples/snippets/visualbasic/VS_Snippets_Remoting/HowToChunkSerializedData/VB/SerializationChunk.vb#3)] - -## Compiling the code - -- The code uses the following namespaces: , , , , , , and . - -## See also - -- [Custom Serialization](custom-serialization.md) diff --git a/docs/standard/serialization/selective-serialization.md b/docs/standard/serialization/selective-serialization.md deleted file mode 100644 index cff049993222d..0000000000000 --- a/docs/standard/serialization/selective-serialization.md +++ /dev/null @@ -1,33 +0,0 @@ ---- -title: "Selective binary serialization" -description: This article shows you how to mark fields with the NonSerialized attribute, which prevents that field from being binary serialized. -ms.date: "08/07/2017" -dev_langs: - - "CSharp" -helpviewer_keywords: - - "serialization, selective serialization" - - "binary serialization, selective serialization" -ms.topic: how-to ---- -# Selective binary serialization - -A class often contains fields that shouldn't be serialized using binary serialization. For example, assume a class stores a thread ID in a member variable. When the class is deserialized, the thread stored the ID for when the class was serialized might no longer be running; so serializing this value doesn't make sense. You can prevent member variables from being serialized by marking them with the [NonSerialized](xref:System.NonSerializedAttribute) attribute as follows. - -```csharp -[Serializable] -public class MyObject -{ - public int n1; - [NonSerialized] public int n2; - public String str; -} -``` - -If possible, make an object that could contain security-sensitive data nonserializable. If the object must be serialized, apply the `NonSerialized` attribute to specific fields that store sensitive data. If you don't exclude these fields from serialization, be aware that the data they store are exposed to any code that has permission to serialize. For more information about writing secure serialization code, see [Security and Serialization](/previous-versions/dotnet/framework/code-access-security/security-and-serialization). - -[!INCLUDE [binary-serialization-warning](../../../includes/binary-serialization-warning.md)] - -## See also - -- [Binary Serialization](binary-serialization.md) -- [XML and SOAP Serialization](xml-and-soap-serialization.md) diff --git a/docs/standard/serialization/serialization-concepts.md b/docs/standard/serialization/serialization-concepts.md deleted file mode 100644 index d8516a93a886d..0000000000000 --- a/docs/standard/serialization/serialization-concepts.md +++ /dev/null @@ -1,33 +0,0 @@ ---- -title: "Serialization concepts" -description: Serialization can be used to capture the state of an object so a copy can be created or to send an object by value from one application domain to another. -ms.date: "08/07/2017" -ms.assetid: e1ff4740-20a1-4c76-a8ad-d857db307054 ---- -# Serialization concepts - -Why would you want to use serialization? The two most important reasons are to persist the state of an object to a storage medium so an exact copy can be re-created at a later stage, and to send the object by value from one application domain to another. For example, serialization is used to save session state in ASP.NET and to copy objects to the Clipboard in Windows Forms. It is also used by remoting to pass objects by value from one application domain to another. - -[!INCLUDE [binary-serialization-warning](../../../includes/binary-serialization-warning.md)] - -## Persistent storage - -It is often necessary to store the value of the fields of an object to disk and then, later, retrieve this data. Although this is easy to achieve without relying on serialization, this approach is often cumbersome and error prone, and becomes progressively more complex when you need to track a hierarchy of objects. Imagine writing a large business application, that contains thousands of objects, and having to write code to save and restore the fields and properties to and from disk for each object. Serialization provides a convenient mechanism for achieving this objective. - -The common language runtime manages how objects are stored in memory and provides an automated serialization mechanism by using [reflection](../../framework/reflection-and-codedom/reflection.md). When an object is serialized, the name of the class, the assembly, and all the data members of the class instance are written to storage. Objects often store references to other instances in member variables. When the class is serialized, the serialization engine tracks referenced objects, already serialized, to ensure that the same object is not serialized more than once. The serialization architecture provided by .NET correctly handles object graphs and circular references automatically. The only requirement placed on object graphs is that all objects, referenced by the serialized object, must also be marked as `Serializable` (for more information, see [Basic Serialization](basic-serialization.md)). If this is not done, an exception will be thrown when the serializer attempts to serialize the unmarked object. - -When the serialized class is deserialized, the class is recreated and the values of all the data members are automatically restored. - -## Marshal by value - -Objects are valid only in the application domain where they are created. Any attempt to pass the object as a parameter or return it as a result will fail unless the object derives from `MarshalByRefObject` or is marked as `Serializable`. If the object is marked as `Serializable`, the object will automatically be serialized, transported from the one application domain to the other, and then deserialized to produce an exact copy of the object in the second application domain. This process is typically referred to as marshal-by-value. - -When an object derives from `MarshalByRefObject`, an object reference is passed from one application domain to another, rather than the object itself. You can also mark an object that derives from `MarshalByRefObject` as `Serializable`. When this object is used with remoting, the formatter responsible for serialization, which has been preconfigured with a surrogate selector (`SurrogateSelector`), takes control of the serialization process, and replaces all objects derived from `MarshalByRefObject` with a proxy. Without the `SurrogateSelector` in place, the serialization architecture follows the standard serialization rules described in [Steps in the Serialization Process](steps-in-the-serialization-process.md). - -## Related sections - - [Binary Serialization](binary-serialization.md) - Describes the binary serialization mechanism that is included with the common language runtime. - - [XML and SOAP Serialization](xml-and-soap-serialization.md) - Describes the XML and SOAP serialization mechanism that is included with the common language runtime. diff --git a/docs/standard/serialization/serialization-guidelines.md b/docs/standard/serialization/serialization-guidelines.md deleted file mode 100644 index d539e0ccf47ab..0000000000000 --- a/docs/standard/serialization/serialization-guidelines.md +++ /dev/null @@ -1,144 +0,0 @@ ---- -title: "Serialization guidelines" -description: This document provides guidelines to consider when designing an API to be serialized and a summary of the different serialization technologies .NET offers. -ms.date: 11/15/2022 -dev_langs: - - "csharp" - - "vb" -helpviewer_keywords: - - "serialization, guidelines" - - "binary serialization, guidelines" -ms.assetid: ebbeddff-179d-443f-bf08-9c373199a73a ---- -# Serialization guidelines - -This article lists the guidelines to consider when designing an API to be serialized. - -[!INCLUDE [binary-serialization-warning](../../../includes/binary-serialization-warning.md)] - - .NET offers the following serialization technologies that are optimized for various serialization scenarios. The following table lists these technologies and the main .NET types related to these technologies. - -| Technology | Relevant classes | Notes | -|------------|------------------|-------| -| JSON serialization | | Introduced in .NET Core 3.0, this is the modern way to serialize to and from JSON. For more information, see [JSON serialization and deserialization](system-text-json/overview.md). | -| Data contract serialization |




|General persistence
Web Services
JSON| -| XML serialization ||XML format
with full control| -| Runtime serialization (binary and SOAP) |


| .NET Remoting
**Warning**: Binary serialization can be dangerous. For more information, see [BinaryFormatter security guide](binaryformatter-security-guide.md). | - - When you design new types, you should decide which, if any, of these technologies those types need to support. The following guidelines describe how to make that choice and how to provide such support. These guidelines are not meant to help you choose which serialization technology you should use in the implementation of your application or library. Such guidelines are not directly related to API design and thus are not within the scope of this topic. - -## Guidelines - -- DO think about serialization when you design new types. - - Serialization is an important design consideration for any type, because programs might need to persist or transmit instances of the type. - -### Choosing the right serialization technology to support - - Any given type can support none, one, or more of the serialization technologies. - -- CONSIDER supporting *data contract serialization* if instances of your type might need to be persisted or used in Web Services. - -- CONSIDER supporting the *XML serialization* instead of or in addition to data contract serialization if you need more control over the XML format that is produced when the type is serialized. - - This may be necessary in some interoperability scenarios where you need to use an XML construct that is not supported by data contract serialization, for example, to produce XML attributes. - -- CONSIDER supporting *runtime serialization* if instances of your type need to travel across .NET Remoting boundaries. - -- AVOID supporting runtime serialization or XML serialization just for general persistence reasons. Prefer data contract serialization instead - -#### Data contract serialization - - Types can support data contract serialization by applying the to the type and the to the members (fields and properties) of the type. - - [!code-csharp[SerializationGuidelines#1](../../../samples/snippets/csharp/VS_Snippets_CFX/serializationguidelines/cs/source.cs#1)] - [!code-vb[SerializationGuidelines#1](../../../samples/snippets/visualbasic/VS_Snippets_CFX/serializationguidelines/vb/source.vb#1)] - -1. CONSIDER marking data members of your type public if the type can be used in partial trust. In full trust, data contract serializers can serialize and deserialize nonpublic types and members, but only public members can be serialized and deserialized in partial trust. - -2. DO implement a getter and setter on all properties that have Data-MemberAttribute. Data contract serializers require both the getter and the setter for the type to be considered serializable. If the type won't be used in partial trust, one or both of the property accessors can be nonpublic. - - [!code-csharp[SerializationGuidelines#2](../../../samples/snippets/csharp/VS_Snippets_CFX/serializationguidelines/cs/source.cs#2)] - [!code-vb[SerializationGuidelines#2](../../../samples/snippets/visualbasic/VS_Snippets_CFX/serializationguidelines/vb/source.vb#2)] - -3. CONSIDER using the serialization callbacks for initialization of deserialized instances. - - Constructors are not called when objects are deserialized. Therefore, any logic that executes during normal construction needs to be implemented as one of the *serialization callbacks*. - - [!code-csharp[SerializationGuidelines#3](../../../samples/snippets/csharp/VS_Snippets_CFX/serializationguidelines/cs/source.cs#3)] - [!code-vb[SerializationGuidelines#3](../../../samples/snippets/visualbasic/VS_Snippets_CFX/serializationguidelines/vb/source.vb#3)] - - The attribute is the most commonly used callback attribute. The other attributes in the family are , - , and . They can be used to mark callbacks that get executed before deserialization, before serialization, and finally, after serialization, respectively. - -4. CONSIDER using the to indicate concrete types that should be used when deserializing a complex object graph. - - For example, if a type of a deserialized data member is represented by an abstract class, the serializer will need the *known type* information to decide what concrete type to instantiate and assign to the member. If the known type is not specified using the attribute, it will need to be passed to the serializer explicitly (you can do it by passing known types to the serializer constructor) or it will need to be specified in the configuration file. - - [!code-csharp[SerializationGuidelines#4](../../../samples/snippets/csharp/VS_Snippets_CFX/serializationguidelines/cs/source.cs#4)] - [!code-vb[SerializationGuidelines#4](../../../samples/snippets/visualbasic/VS_Snippets_CFX/serializationguidelines/vb/source.vb#4)] - - In cases where the list of known types is not known statically (when the **Person** class is compiled), the **KnownTypeAttribute** can also point to a method that returns a list of known types at run time. - -5. DO consider backward and forward compatibility when creating or changing serializable types. - - Keep in mind that serialized streams of future versions of your type can be deserialized into the current version of the type, and vice versa. Make sure you understand that data members, even private and internal, cannot change their names, types, or even their order in future versions of the type unless special care is taken to preserve the contract using explicit parameters to the data contract attributes.Test compatibility of serialization when making changes to serializable types. Try deserializing the new version into an old version, and vice versa. - -6. CONSIDER implementing interface to allow round-tripping between different versions of the type. - - The interface allows the serializer to ensure that no data is lost during round-tripping. The property stores any data from the future version of the type that is unknown to the current version. When the current version is subsequently serialized and deserialized into a future version, the additional data will be available in the serialized stream through the **ExtensionData** property value. - - [!code-csharp[SerializationGuidelines#5](../../../samples/snippets/csharp/VS_Snippets_CFX/serializationguidelines/cs/source.cs#5)] - [!code-vb[SerializationGuidelines#5](../../../samples/snippets/visualbasic/VS_Snippets_CFX/serializationguidelines/vb/source.vb#5)] - - For more information, see [Forward-Compatible Data Contracts](../../framework/wcf/feature-details/forward-compatible-data-contracts.md). - -#### XML serialization - - Data contract serialization is the main (default) serialization technology in .NET Framework, but there are serialization scenarios that data contract serialization does not support. For example, it does not give you full control over the shape of XML produced or consumed by the serializer. If such fine control is required, *XML serialization* has to be used, and you need to design your types to support this serialization technology. - -1. AVOID designing your types specifically for XML Serialization, unless you have a very strong reason to control the shape of the XML produced. This serialization technology has been superseded by the Data Contract Serialization discussed in the previous section. - - In other words, don't apply attributes from the namespace to new types, unless you know that the type will be used with XML Serialization. The following example shows how **System.Xml.Serialization** can be used to control the shape of the XML -produced. - - [!code-csharp[SerializationGuidelines#6](../../../samples/snippets/csharp/VS_Snippets_CFX/serializationguidelines/cs/source.cs#6)] - [!code-vb[SerializationGuidelines#6](../../../samples/snippets/visualbasic/VS_Snippets_CFX/serializationguidelines/vb/source.vb#6)] - -2. CONSIDER implementing the interface if you want even more control over the shape of the serialized XML than what's offered by applying the XML Serialization attributes. Two methods of the interface, and , allow you to fully control the serialized XML stream. You can also control the XML schema that gets generated for the type by applying the attribute. - -#### Runtime serialization - - *Runtime serialization* is a technology used by .NET Remoting. If you think your types will be transported using .NET Remoting, make sure they support runtime serialization. - - The basic support for *runtime serialization* can be provided by applying the attribute, and more advanced scenarios involve implementing a simple *runtime serializable pattern* (implement - and provide a serialization constructor). - -1. CONSIDER supporting runtime serialization if your types will be used with .NET Remoting. For example, the namespace uses .NET Remoting, and so all types exchanged between **System.AddIn** add-ins need to support runtime serialization. - - [!code-csharp[SerializationGuidelines#7](../../../samples/snippets/csharp/VS_Snippets_CFX/serializationguidelines/cs/source.cs#7)] - [!code-vb[SerializationGuidelines#7](../../../samples/snippets/visualbasic/VS_Snippets_CFX/serializationguidelines/vb/source.vb#7)] - -2. CONSIDER implementing the *runtime serializable pattern* if you want complete control over the serialization process. For example, if you want to transform data as it gets serialized or deserialized. - - The pattern is very simple. All you need to do is implement the interface and provide a special constructor that is used when the object is deserialized. - - [!code-csharp[SerializationGuidelines#8](../../../samples/snippets/csharp/VS_Snippets_CFX/serializationguidelines/cs/source.cs#8)] - [!code-vb[SerializationGuidelines#8](../../../samples/snippets/visualbasic/VS_Snippets_CFX/serializationguidelines/vb/source.vb#8)] - -3. DO make the serialization constructor protected and provide two parameters typed and named exactly as shown in the sample here. - - [!code-csharp[SerializationGuidelines#9](../../../samples/snippets/csharp/VS_Snippets_CFX/serializationguidelines/cs/source.cs#9)] - [!code-vb[SerializationGuidelines#9](../../../samples/snippets/visualbasic/VS_Snippets_CFX/serializationguidelines/vb/source.vb#9)] - -4. DO implement the ISerializable members explicitly. - - [!code-csharp[SerializationGuidelines#10](../../../samples/snippets/csharp/VS_Snippets_CFX/serializationguidelines/cs/source.cs#10)] - [!code-vb[SerializationGuidelines#10](../../../samples/snippets/visualbasic/VS_Snippets_CFX/serializationguidelines/vb/source.vb#10)] - -## See also - -- [Using Data Contracts](../../framework/wcf/feature-details/using-data-contracts.md) -- [Data Contract Serializer](../../framework/wcf/feature-details/data-contract-serializer.md) -- [Types Supported by the Data Contract Serializer](../../framework/wcf/feature-details/types-supported-by-the-data-contract-serializer.md) -- [Binary Serialization](binary-serialization.md) -- [.NET Remoting](/previous-versions/dotnet/netframework-4.0/72x4h507(v=vs.100)) -- [XML and SOAP Serialization](xml-and-soap-serialization.md) diff --git a/docs/standard/serialization/steps-in-the-serialization-process.md b/docs/standard/serialization/steps-in-the-serialization-process.md deleted file mode 100644 index 7972c0360624d..0000000000000 --- a/docs/standard/serialization/steps-in-the-serialization-process.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: "Steps in the binary serialization process" -description: The binary serialization process begins when the Serialize method is called on a formatter. This article describes the sequence of events. -ms.date: "08/07/2017" -helpviewer_keywords: - - "binary serialization, steps" - - "serialization, steps" -ms.assetid: 4bcbc883-2a91-418f-b968-6c86a25e9737 ---- -# Steps in the binary serialization process - -When the method is called on a [formatter](xref:System.Runtime.Serialization.Formatter), object serialization proceeds according to the following sequence of rules: - -- A check is made to determine whether the formatter has a surrogate selector. If the formatter does, check whether the surrogate selector handles objects of the given type. If the selector handles the object type, is called on the surrogate selector. - -- If there is no surrogate selector or if it does not handle the object type, a check is made to determine whether the object is marked with the [Serializable](xref:System.SerializableAttribute) attribute. If the object is not, a is thrown. - -- If the object is marked appropriately, check whether the object implements the interface. If the object does, is called on the object. - -- If the object does not implement , the default serialization policy is used, serializing all fields not marked as [NonSerialized](xref:System.NonSerializedAttribute). - -[!INCLUDE [binary-serialization-warning](../../../includes/binary-serialization-warning.md)] - -## See also - -- [Binary Serialization](binary-serialization.md) -- [XML and SOAP Serialization](xml-and-soap-serialization.md) diff --git a/docs/standard/serialization/version-tolerant-serialization.md b/docs/standard/serialization/version-tolerant-serialization.md deleted file mode 100644 index 63ec5309ff083..0000000000000 --- a/docs/standard/serialization/version-tolerant-serialization.md +++ /dev/null @@ -1,288 +0,0 @@ ---- -title: "Version-tolerant binary serialization" -description: Learn about Version Tolerant Serialization, a set of features that make it easier to modify serializable types. -ms.date: "08/08/2017" -dev_langs: - - "csharp" - - "vb" -helpviewer_keywords: - - "version tolerant serialization" - - "serialization, custom serialization" - - "serialization, version tolerant" - - "serialization, controlling" - - "versions and serialization" - - "serialization, attributes" -ms.assetid: bea0ffe3-2708-4a16-ac7d-e586ed6b8e8d ---- -# Version tolerant binary serialization - -In the earliest versions of .NET Framework, creating binary-serializable types that would be reusable from one version of an application to the next was problematic. If a type was modified by adding extra fields, the following problems would occur: - -- Older versions of an application would throw exceptions when asked to deserialize new versions of the old type. -- Newer versions of an application would throw exceptions when deserializing older versions of a type with missing data. - -Version tolerant serialization (VTS) refers to a set of features that make it easier, over time, to modify binary-serializable types. Specifically, the VTS features are enabled for classes to which the attribute has been applied, including generic types. VTS makes it possible to add new fields to those classes without breaking compatibility with other versions of the type. - -The VTS features are enabled when using the . Additionally, all features except extraneous data tolerance are also enabled when using the . For more information about using these classes for serialization, see [Binary Serialization](binary-serialization.md). - -[!INCLUDE [binary-serialization-warning](../../../includes/binary-serialization-warning.md)] - -## Feature list - -The set of features includes the following: - -- Tolerance of extraneous or unexpected data. This enables newer versions of the type to send data to older versions. -- Tolerance of missing optional data. This enables older versions to send data to newer versions. -- Serialization callbacks. This enables intelligent default value setting in cases where data is missing. - -In addition, there is a feature for declaring when a new optional field has been added. This is the property of the attribute. - -These features are discussed in greater detail in the following sections. - -### Tolerance of extraneous or unexpected data - -In the past, during deserialization, any extraneous or unexpected data caused exceptions to be thrown. With VTS, in the same situation, any extraneous or unexpected data is ignored instead of causing exceptions to be thrown. This enables applications that use newer versions of a type (that is, a version that includes more fields) to send information to applications that expect older versions of the same type. - -In the following example, the extra data contained in the `CountryField` of version 2.0 of the `Address` class is ignored when an older application deserializes the newer version. - -```csharp -// Version 1 of the Address class. -[Serializable] -public class Address -{ - public string Street; - public string City; -} -// Version 2.0 of the Address class. -[Serializable] -public class Address -{ - public string Street; - public string City; - // The older application ignores this data. - public string CountryField; -} -``` - -```vb -' Version 1 of the Address class. - _ -Public Class Address - Public Street As String - Public City As String -End Class - -' Version 2.0 of the Address class. - _ -Public Class Address - Public Street As String - Public City As String - ' The older application ignores this data. - Public CountryField As String -End Class -``` - -### Tolerance of missing data - -Fields can be marked as optional by applying the attribute to them. During deserialization, if the optional data is missing, the serialization engine ignores the absence and does not throw an exception. Thus, applications that expect older versions of a type can send data to applications that expect newer versions of the same type. - -The following example shows version 2.0 of the `Address` class with the `CountryField` field marked as optional. If an older application sends version 1 to a newer application that expects version 2.0, the absence of the data is ignored. - -```csharp -[Serializable] -public class Address -{ - public string Street; - public string City; - - [OptionalField] - public string CountryField; -} -``` - -```vb - _ -Public Class Address - Public Street As String - Public City As String - - _ - Public CountryField As String -End Class -``` - -### Serialization callbacks - -Serialization callbacks are a mechanism that provides hooks into the serialization/deserialization process at four points. - -|Attribute|When the Associated Method is Called|Typical Use| -|---------------|------------------------------------------|-----------------| -||Before deserialization.\*|Initialize default values for optional fields.| -||After deserialization.|Fix optional field values based on contents of other fields.| -||Before serialization.|Prepare for serialization. For example, create optional data structures.| -||After serialization.|Log serialization events.| - - \* This callback is invoked before the deserialization constructor, if one is present. - -#### Using callbacks - -To use callbacks, apply the appropriate attribute to a method that accepts a parameter. Only one method per class can be marked with each of these attributes. For example: - -```csharp -[OnDeserializing] -private void SetCountryRegionDefault(StreamingContext sc) -{ - CountryField = "Japan"; -} -``` - -```vb - -Private Sub SetCountryRegionDefault(sc As StreamingContext) - CountryField = "Japan" -End Sub -``` - -The intended use of these methods is for versioning. During deserialization, an optional field may not be correctly initialized if the data for the field is missing. This can be corrected by creating the method that assigns the correct value, then applying either the **OnDeserializingAttribute** or **OnDeserializedAttribute** attribute to the method. - -The following example shows the method in the context of a type. If an earlier version of an application sends an instance of the `Address` class to a later version of the application, the `CountryField` field data will be missing. But after deserialization, the field will be set to a default value "Japan". - -```csharp -[Serializable] -public class Address -{ - public string Street; - public string City; - [OptionalField] - public string CountryField; - - [OnDeserializing] - private void SetCountryRegionDefault(StreamingContext sc) - { - CountryField = "Japan"; - } -} -``` - -```vb - _ -Public Class Address - Public Street As String - Public City As String - _ - Public CountryField As String - - _ - Private Sub SetCountryRegionDefault(sc As StreamingContext) - CountryField = "Japan" - End Sub -End Class -``` - -## The VersionAdded property - -The **OptionalFieldAttribute** has the **VersionAdded** property. The property indicates which version of a type a given field has been added. It should be incremented by exactly one (starting at 2) every time the type is modified, as shown in the following example: - -```csharp -// Version 1.0 -[Serializable] -public class Person -{ - public string FullName; -} - -// Version 2.0 -[Serializable] -public class Person -{ - public string FullName; - - [OptionalField(VersionAdded = 2)] - public string NickName; - [OptionalField(VersionAdded = 2)] - public DateTime BirthDate; -} - -// Version 3.0 -[Serializable] -public class Person -{ - public string FullName; - - [OptionalField(VersionAdded=2)] - public string NickName; - [OptionalField(VersionAdded=2)] - public DateTime BirthDate; - - [OptionalField(VersionAdded=3)] - public int Weight; -} -``` - -```vb -' Version 1.0 - _ -Public Class Person - Public FullName -End Class - -' Version 2.0 - _ -Public Class Person - Public FullName As String - - _ - Public NickName As String - _ - Public BirthDate As DateTime -End Class - -' Version 3.0 - _ -Public Class Person - Public FullName As String - - _ - Public NickName As String - _ - Public BirthDate As DateTime - - _ - Public Weight As Integer -End Class -``` - -## SerializationBinder - -Some users may need to control which class to serialize and deserialize because a different version of the class is required on the server and client. is an abstract class used to control the actual types used during serialization and deserialization. To use this class, derive a class from and override the and methods. - -## Best practices - -To ensure proper versioning behavior, follow these rules when modifying a type from version to version: - -- Never remove a serialized field. -- Never apply the attribute to a field if the attribute was not applied to the field in the previous version. -- Never change the name or the type of a serialized field. -- When adding a new serialized field, apply the **OptionalFieldAttribute** attribute. -- When removing a **NonSerializedAttribute** attribute from a field (that was not serializable in a previous version), apply the **OptionalFieldAttribute** attribute. -- For all optional fields, set meaningful defaults using the serialization callbacks unless 0 or **null** as defaults are acceptable. - -To ensure that a type will be compatible with future serialization engines, follow these guidelines: - -- Always set the **VersionAdded** property on the **OptionalFieldAttribute** attribute correctly. -- Avoid branched versioning. - -## See also - -- -- -- -- -- -- -- -- -- -- -- -- [Binary Serialization](binary-serialization.md) From 17dfc77e1ee01bb54996671d2c2492cfe0ad93ee Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Fri, 31 Mar 2023 16:16:08 -0700 Subject: [PATCH 2/5] updates --- .openpublishing.redirection.json | 50 --- .openpublishing.redirection.standard.json | 47 ++- docs/fundamentals/toc.yml | 361 +++++++++--------- .../how-to-chunk-serialized-data.md | 59 +++ 4 files changed, 296 insertions(+), 221 deletions(-) create mode 100644 docs/standard/serialization/how-to-chunk-serialized-data.md diff --git a/.openpublishing.redirection.json b/.openpublishing.redirection.json index 8bdaec37241b9..809da45e8afc8 100644 --- a/.openpublishing.redirection.json +++ b/.openpublishing.redirection.json @@ -1,55 +1,5 @@ { "redirections": [ - { - "source_path": "docs/standard/serialization/binary-serialization.md", - "redirect_url": "/previous-versions/dotnet/standard/serialization/binary-serialization", - "redirect_document_id": false - }, - { - "source_path": "docs/standard/serialization/binaryformatter-event-source.md", - "redirect_url": "/previous-versions/dotnet/standard/serialization/binaryformatter-event-source", - "redirect_document_id": false - }, - { - "source_path": "docs/standard/serialization/serialization-concepts.md", - "redirect_url": "/previous-versions/dotnet/standard/serialization/serialization-concepts", - "redirect_document_id": false - }, - { - "source_path": "docs/standard/serialization/basic-serialization.md", - "redirect_url": "/previous-versions/dotnet/standard/serialization/basic-serialization", - "redirect_document_id": false - }, - { - "source_path": "docs/standard/serialization/selective-serialization.md", - "redirect_url": "/previous-versions/dotnet/standard/serialization/selective-serialization", - "redirect_document_id": false - }, - { - "source_path": "docs/standard/serialization/custom-serialization.md", - "redirect_url": "/previous-versions/dotnet/standard/serialization/custom-serialization", - "redirect_document_id": false - }, - { - "source_path": "docs/standard/serialization/steps-in-the-serialization-process.md", - "redirect_url": "/previous-versions/dotnet/standard/serialization/steps-in-the-serialization-process", - "redirect_document_id": false - }, - { - "source_path": "docs/standard/serialization/version-tolerant-serialization.md", - "redirect_url": "/previous-versions/dotnet/standard/serialization/version-tolerant-serialization", - "redirect_document_id": false - }, - { - "source_path": "docs/standard/serialization/serialization-guidelines.md", - "redirect_url": "/previous-versions/dotnet/standard/serialization/serialization-guidelines", - "redirect_document_id": false - }, - { - "source_path": "docs/standard/serialization/how-to-chunk-serialized-data.md", - "redirect_url": "/previous-versions/dotnet/standard/serialization/how-to-chunk-serialized-data", - "redirect_document_id": false - }, { "source_path_from_root": "/docs/about/index.md", "redirect_url": "/dotnet/fundamentals/" diff --git a/.openpublishing.redirection.standard.json b/.openpublishing.redirection.standard.json index 7916d4fad0e0f..0b5d8648b67cb 100644 --- a/.openpublishing.redirection.standard.json +++ b/.openpublishing.redirection.standard.json @@ -628,7 +628,7 @@ { "source_path_from_root": "/docs/standard/serialization/write-custom-serializer-deserializer.md", "redirect_url": "/dotnet/standard/serialization/system-text-json/use-dom-utf8jsonreader-utf8jsonwriter" - }, + }, { "source_path_from_root": "/docs/standard/serialization/system-text-json-character-casing.md", "redirect_url": "/dotnet/standard/serialization/system-text-json/character-casing", @@ -719,6 +719,51 @@ "redirect_url": "/dotnet/standard/serialization/system-text-json/use-dom-utf8jsonreader-utf8jsonwriter", "redirect_document_id": true }, + { + "source_path": "docs/standard/serialization/binary-serialization.md", + "redirect_url": "/previous-versions/dotnet/fundamentals/serialization/binary/binary-serialization", + "redirect_document_id": false + }, + { + "source_path": "docs/standard/serialization/binaryformatter-event-source.md", + "redirect_url": "/previous-versions/dotnet/fundamentals/serialization/binary/binaryformatter-event-source", + "redirect_document_id": false + }, + { + "source_path": "docs/standard/serialization/serialization-concepts.md", + "redirect_url": "/previous-versions/dotnet/fundamentals/serialization/serialization-concepts", + "redirect_document_id": false + }, + { + "source_path": "docs/standard/serialization/basic-serialization.md", + "redirect_url": "/previous-versions/dotnet/fundamentals/serialization/basic-serialization", + "redirect_document_id": false + }, + { + "source_path": "docs/standard/serialization/selective-serialization.md", + "redirect_url": "/previous-versions/dotnet/fundamentals/serialization/binary/selective-serialization", + "redirect_document_id": false + }, + { + "source_path": "docs/standard/serialization/custom-serialization.md", + "redirect_url": "/previous-versions/dotnet/fundamentals/serialization/binary/custom-serialization", + "redirect_document_id": false + }, + { + "source_path": "docs/standard/serialization/steps-in-the-serialization-process.md", + "redirect_url": "/previous-versions/dotnet/fundamentals/serialization/binary/steps-in-the-serialization-process", + "redirect_document_id": false + }, + { + "source_path": "docs/standard/serialization/version-tolerant-serialization.md", + "redirect_url": "/previous-versions/dotnet/fundamentals/serialization/binary/version-tolerant-serialization", + "redirect_document_id": false + }, + { + "source_path": "docs/standard/serialization/serialization-guidelines.md", + "redirect_url": "/previous-versions/dotnet/fundamentals/serialization/serialization-guidelines", + "redirect_document_id": false + }, { "source_path_from_root": "/docs/standard/threading/autoresetevent.md", "redirect_url": "/dotnet/api/system.threading.autoresetevent" diff --git a/docs/fundamentals/toc.yml b/docs/fundamentals/toc.yml index 281ba90fad1de..7a982e78082f5 100644 --- a/docs/fundamentals/toc.yml +++ b/docs/fundamentals/toc.yml @@ -92,69 +92,69 @@ items: - name: Use Visual Studio items: - name: Create a console app - displayName: tutorials, visual studio, vs href: ../core/tutorials/with-visual-studio.md - - name: Debug an app displayName: tutorials, visual studio, vs + - name: Debug an app href: ../core/tutorials/debugging-with-visual-studio.md - - name: Publish an app displayName: tutorials, visual studio, vs + - name: Publish an app href: ../core/tutorials/publishing-with-visual-studio.md - - name: Create a library displayName: tutorials, visual studio, vs + - name: Create a library href: ../core/tutorials/library-with-visual-studio.md - - name: Unit test a library displayName: tutorials, visual studio, vs + - name: Unit test a library href: ../core/tutorials/testing-library-with-visual-studio.md - - name: Install and use a package displayName: tutorials, visual studio, vs + - name: Install and use a package href: /nuget/quickstart/install-and-use-a-package-in-visual-studio?toc=/dotnet/fundamentals/toc.json&bc=/dotnet/breadcrumb/toc.json - - name: Create and publish a package displayName: tutorials, visual studio, vs + - name: Create and publish a package href: /nuget/quickstart/create-and-publish-a-package-using-visual-studio?toc=/dotnet/fundamentals/toc.json&bc=/dotnet/breadcrumb/toc.json + displayName: tutorials, visual studio, vs - name: Use Visual Studio Code items: - name: Create a console app - displayName: tutorials, visual studio code, vs code, cli href: ../core/tutorials/with-visual-studio-code.md + displayName: tutorials, visual studio code, vs code, cli - name: Debug an app - displayName: tutorials, visual studio code, vs code href: ../core/tutorials/debugging-with-visual-studio-code.md - - name: Publish an app displayName: tutorials, visual studio code, vs code + - name: Publish an app href: ../core/tutorials/publishing-with-visual-studio-code.md - - name: Create a library displayName: tutorials, visual studio code, vs code + - name: Create a library href: ../core/tutorials/library-with-visual-studio-code.md - - name: Unit test a library displayName: tutorials, visual studio code, vs code + - name: Unit test a library href: ../core/tutorials/testing-library-with-visual-studio-code.md + displayName: tutorials, visual studio code, vs code - name: Install and use a package - displayName: tutorials, cli href: /nuget/quickstart/install-and-use-a-package-using-the-dotnet-cli?toc=/dotnet/fundamentals/toc.json&bc=/dotnet/breadcrumb/toc.json + displayName: tutorials, cli - name: Create and publish a package - displayName: tutorials href: /nuget/quickstart/create-and-publish-a-package-using-the-dotnet-cli?toc=/dotnet/fundamentals/toc.json&bc=/dotnet/breadcrumb/toc.json + displayName: tutorials - name: Use Visual Studio for Mac items: - name: Create a console app - displayName: tutorials, visual studio for mac, vs for mac, cli href: ../core/tutorials/with-visual-studio-mac.md + displayName: tutorials, visual studio for mac, vs for mac, cli - name: Debug an app - displayName: tutorials, visual studio for mac, vs for mac href: ../core/tutorials/debugging-with-visual-studio-mac.md - - name: Publish an app displayName: tutorials, visual studio for mac, vs for mac + - name: Publish an app href: ../core/tutorials/publishing-with-visual-studio-mac.md - - name: Create a library displayName: tutorials, visual studio for mac, vs for mac + - name: Create a library href: ../core/tutorials/library-with-visual-studio-mac.md - - name: Unit test a library displayName: tutorials, visual studio for mac, vs for mac + - name: Unit test a library href: ../core/tutorials/testing-library-with-visual-studio-mac.md - - name: Install and use a package displayName: tutorials, visual studio for mac, vs for mac + - name: Install and use a package href: /nuget/quickstart/install-and-use-a-package-in-visual-studio-mac?toc=/dotnet/fundamentals/toc.json&bc=/dotnet/breadcrumb/toc.json + displayName: tutorials, visual studio for mac, vs for mac - name: More tutorials href: ../core/tutorials/index.md - name: What's new in .NET @@ -246,8 +246,8 @@ items: - name: Collections and data structures items: - name: Overview - displayName: collections, data structures href: ../standard/collections/index.md + displayName: collections, data structures - name: Select a collection class href: ../standard/collections/selecting-a-collection-class.md - name: Commonly used collection types @@ -267,8 +267,8 @@ items: - name: Events items: - name: Overview - displayName: events href: ../standard/events/index.md + displayName: events - name: Raise and consume events href: ../standard/events/how-to-raise-and-consume-events.md - name: Handle multiple events using event properties @@ -276,19 +276,19 @@ items: - name: Observer design pattern items: - name: Overview - displayName: Observer design pattern href: ../standard/events/observer-design-pattern.md + displayName: Observer design pattern - name: Best practices href: ../standard/events/observer-design-pattern-best-practices.md - - name: 'How to: Implement a provider' + - name: "How to: Implement a provider" href: ../standard/events/how-to-implement-a-provider.md - - name: 'How to: Implement an observer' + - name: "How to: Implement an observer" href: ../standard/events/how-to-implement-an-observer.md - name: Exceptions items: - name: Overview - displayName: exceptions href: ../standard/exceptions/index.md + displayName: exceptions - name: Exception class and properties href: ../standard/exceptions/exception-class-and-properties.md - name: How-tos @@ -316,7 +316,7 @@ items: - name: Dates, times, and time zones items: - name: Overview - displayName: dates,times,time zones + displayName: dates,times,time zones href: ../standard/datetime/index.md - name: Choose which date and time type to use href: ../standard/datetime/choosing-between-datetime.md @@ -326,7 +326,7 @@ items: href: ../standard/datetime/how-to-use-dateonly-timeonly.md - name: Perform arithmetic operations href: ../standard/datetime/performing-arithmetic-operations.md - - name: DateTime and DateTimeOffset support in System.Text.Json + - name: "DateTime and DateTimeOffset support in System.Text.Json" href: ../standard/datetime/system-text-json-support.md - name: Time zones items: @@ -338,9 +338,9 @@ items: href: ../standard/datetime/converting-between-datetime-and-offset.md - name: Convert times between time zones href: ../standard/datetime/converting-between-time-zones.md - - name: 'How to: Resolve ambiguous times' + - name: "How to: Resolve ambiguous times" href: ../standard/datetime/resolve-ambiguous-times.md - - name: 'How to: Let users resolve ambiguous times' + - name: "How to: Let users resolve ambiguous times" href: ../standard/datetime/let-users-resolve-ambiguous-times.md - name: Instantiate a DateTimeOffset object items: @@ -371,8 +371,8 @@ items: - name: Attributes items: - name: Overview - displayName: attributes href: ../standard/attributes/index.md + displayName: attributes - name: Apply attributes href: ../standard/attributes/applying-attributes.md - name: Write custom attributes @@ -444,8 +444,8 @@ items: - name: Basic string operations items: - name: Overview - displayName: string operations href: ../standard/base-types/basic-string-operations.md + displayName: string operations - name: Create new strings href: ../standard/base-types/creating-new.md - name: Trim and remove characters @@ -460,7 +460,7 @@ items: href: ../standard/base-types/divide-up-strings.md - name: Use the StringBuilder class href: ../standard/base-types/stringbuilder.md - - name: 'How to: Perform basic string manipulations' + - name: "How to: Perform basic string manipulations" href: ../standard/base-types/basic-manipulations.md - name: Parse (convert) strings items: @@ -475,11 +475,11 @@ items: - name: Regular expressions items: - name: Overview - displayName: regular expressions href: ../standard/base-types/regular-expressions.md + displayName: regular expressions - name: Source generation - displayName: regular expressions,advanced,design concepts,source generators,algorithmic reduction,regex href: ../standard/base-types/regular-expression-source-generators.md + displayName: regular expressions,advanced,design concepts,source generators,algorithmic reduction,regex - name: Language reference items: - name: Overview @@ -537,8 +537,8 @@ items: - name: JSON serialization items: - name: Overview - displayName: json serialization href: ../standard/serialization/system-text-json/overview.md + displayName: json serialization - name: Reflection vs. source generation href: ../standard/serialization/system-text-json/source-generation-modes.md - name: How to serialize and deserialize JSON @@ -587,8 +587,29 @@ items: href: ../standard/serialization/system-text-json/custom-contracts.md - name: Binary serialization items: + - name: Overview + href: ../standard/serialization/binary-serialization.md + displayName: binary serialization - name: BinaryFormatter security guide href: ../standard/serialization/binaryformatter-security-guide.md + - name: BinaryFormatter event source + href: ../standard/serialization/binaryformatter-event-source.md + - name: Serialization concepts + href: ../standard/serialization/serialization-concepts.md + - name: Basic serialization + href: ../standard/serialization/basic-serialization.md + - name: Selective serialization + href: ../standard/serialization/selective-serialization.md + - name: Custom serialization + href: ../standard/serialization/custom-serialization.md + - name: Steps in the serialization process + href: ../standard/serialization/steps-in-the-serialization-process.md + - name: Version-tolerant serialization + href: ../standard/serialization/version-tolerant-serialization.md + - name: Serialization guidelines + href: ../standard/serialization/serialization-guidelines.md + - name: "How to: Chunk serialized data" + href: ../standard/serialization/how-to-chunk-serialized-data.md - name: XML and SOAP serialization items: - name: Overview @@ -674,29 +695,29 @@ items: - name: Common I/O tasks href: ../standard/io/common-i-o-tasks.md items: - - name: 'How to: Copy Directories' + - name: "How to: Copy Directories" href: ../standard/io/how-to-copy-directories.md - - name: 'How to: Enumerate Directories and Files' + - name: "How to: Enumerate Directories and Files" href: ../standard/io/how-to-enumerate-directories-and-files.md - - name: 'How to: Read and Write to a Newly Created Data File' + - name: "How to: Read and Write to a Newly Created Data File" href: ../standard/io/how-to-read-and-write-to-a-newly-created-data-file.md - - name: 'How to: Open and Append to a Log File' + - name: "How to: Open and Append to a Log File" href: ../standard/io/how-to-open-and-append-to-a-log-file.md - - name: 'How to: Write Text to a File' + - name: "How to: Write Text to a File" href: ../standard/io/how-to-write-text-to-a-file.md - - name: 'How to: Read Text from a File' + - name: "How to: Read Text from a File" href: ../standard/io/how-to-read-text-from-a-file.md - - name: 'How to: Read Characters from a String' + - name: "How to: Read Characters from a String" href: ../standard/io/how-to-read-characters-from-a-string.md - - name: 'How to: Write Characters to a String' + - name: "How to: Write Characters to a String" href: ../standard/io/how-to-write-characters-to-a-string.md - - name: 'How to: Add or Remove Access Control List Entries' + - name: "How to: Add or Remove Access Control List Entries" href: ../standard/io/how-to-add-or-remove-access-control-list-entries.md - - name: 'How to: Compress and Extract Files' + - name: "How to: Compress and Extract Files" href: ../standard/io/how-to-compress-and-extract-files.md - name: Composing Streams href: ../standard/io/composing-streams.md - - name: 'How to: Convert Between .NET Framework Streams and Windows Runtime Streams' + - name: "How to: Convert Between .NET Framework Streams and Windows Runtime Streams" href: ../standard/io/how-to-convert-between-dotnet-streams-and-winrt-streams.md - name: Asynchronous file I/O href: ../standard/io/asynchronous-file-i-o.md @@ -707,28 +728,28 @@ items: items: - name: Types of Isolation href: ../standard/io/types-of-isolation.md - - name: 'How to: Obtain Stores for Isolated Storage' + - name: "How to: Obtain Stores for Isolated Storage" href: ../standard/io/how-to-obtain-stores-for-isolated-storage.md - - name: 'How to: Enumerate Stores for Isolated Storage' + - name: "How to: Enumerate Stores for Isolated Storage" href: ../standard/io/how-to-enumerate-stores-for-isolated-storage.md - - name: 'How to: Delete Stores in Isolated Storage' + - name: "How to: Delete Stores in Isolated Storage" href: ../standard/io/how-to-delete-stores-in-isolated-storage.md - - name: 'How to: Anticipate Out-of-Space Conditions with Isolated Storage' + - name: "How to: Anticipate Out-of-Space Conditions with Isolated Storage" href: ../standard/io/how-to-anticipate-out-of-space-conditions-with-isolated-storage.md - - name: 'How to: Create Files and Directories in Isolated Storage' + - name: "How to: Create Files and Directories in Isolated Storage" href: ../standard/io/how-to-create-files-and-directories-in-isolated-storage.md - - name: 'How to: Find Existing Files and Directories in Isolated Storage' + - name: "How to: Find Existing Files and Directories in Isolated Storage" href: ../standard/io/how-to-find-existing-files-and-directories-in-isolated-storage.md - - name: 'How to: Read and Write to Files in Isolated Storage' + - name: "How to: Read and Write to Files in Isolated Storage" href: ../standard/io/how-to-read-and-write-to-files-in-isolated-storage.md - - name: 'How to: Delete Files and Directories in Isolated Storage' + - name: "How to: Delete Files and Directories in Isolated Storage" href: ../standard/io/how-to-delete-files-and-directories-in-isolated-storage.md - name: Pipes href: ../standard/io/pipe-operations.md items: - - name: 'How to: Use Anonymous Pipes for Local Interprocess Communication' + - name: "How to: Use Anonymous Pipes for Local Interprocess Communication" href: ../standard/io/how-to-use-anonymous-pipes-for-local-interprocess-communication.md - - name: 'How to: Use Named Pipes for Network Interprocess Communication' + - name: "How to: Use Named Pipes for Network Interprocess Communication" href: ../standard/io/how-to-use-named-pipes-for-network-interprocess-communication.md - name: Pipelines href: ../standard/io/pipelines.md @@ -741,140 +762,140 @@ items: - name: Dependency injection items: - name: Overview - displayName: dependency injection,di,ioc,ioc container,dependency container,inversion of control href: ../core/extensions/dependency-injection.md + displayName: dependency injection,di,ioc,ioc container,dependency container,inversion of control - name: Use dependency injection - displayName: use dependency injection,di,di examples,ioc,ioc container,dependency container,inversion of control href: ../core/extensions/dependency-injection-usage.md + displayName: use dependency injection,di,di examples,ioc,ioc container,dependency container,inversion of control - name: Dependency injection guidelines - displayName: dependency injection best practices,guidelines,di,ioc,ioc container,dependency container,inversion of control href: ../core/extensions/dependency-injection-guidelines.md + displayName: dependency injection best practices,guidelines,di,ioc,ioc container,dependency container,inversion of control - name: Configuration items: - name: Overview - displayName: configuration,config,configuration sources,config sources href: ../core/extensions/configuration.md + displayName: configuration,config,configuration sources,config sources - name: Configuration providers - displayName: configuration providers,config providers href: ../core/extensions/configuration-providers.md + displayName: configuration providers,config providers - name: Implement a custom configuration provider - displayName: custom configuration,custom config,custom configuration provider,custom config provider href: ../core/extensions/custom-configuration-provider.md + displayName: custom configuration,custom config,custom configuration provider,custom config provider - name: Options pattern - displayName: options pattern,options,configuration options,config options href: ../core/extensions/options.md + displayName: options pattern,options,configuration options,config options - name: Options pattern guidance for library authors - displayName: options pattern guidance,options guidance,configuration options guidance,config options guidance href: ../core/extensions/options-library-authors.md + displayName: options pattern guidance,options guidance,configuration options guidance,config options guidance - name: Logging items: - name: Overview - displayName: logging,logger,log,loggers href: ../core/extensions/logging.md + displayName: logging,logger,log,loggers - name: Logging providers - displayName: logging providers,log providers href: ../core/extensions/logging-providers.md + displayName: logging providers,log providers - name: Compile-time logging source generation - displayName: LoggerMessage,LoggerMessageAttribute,source generator,compile-time generation href: ../core/extensions/logger-message-generator.md + displayName: LoggerMessage,LoggerMessageAttribute,source generator,compile-time generation - name: Implement a custom logging provider - displayName: custom logging,custom log,custom logging provider,custom log provider href: ../core/extensions/custom-logging-provider.md + displayName: custom logging,custom log,custom logging provider,custom log provider - name: High-performance logging - displayName: high-performance logging,high-performance log,high-performance logging provider,high-performance log provider href: ../core/extensions/high-performance-logging.md + displayName: high-performance logging,high-performance log,high-performance logging provider,high-performance log provider - name: Console log formatting - displayName: console log formatting,console log formatter,console log formatting provider,console log formatter provider href: ../core/extensions/console-log-formatter.md + displayName: console log formatting,console log formatter,console log formatting provider,console log formatter provider - name: HostBuilder (generic host) href: ../core/extensions/generic-host.md - name: Networking items: - name: Network programming - displayName: networking,sockets,socket,socket programming,socket client,socket server,socket client server,socket client-server,socket client-server,socket client/server,socket client/server,socket client-serve href: networking/overview.md + displayName: networking,sockets,socket,socket programming,socket client,socket server,socket client server,socket client-server,socket client-server,socket client/server,socket client/server,socket client-serve - name: Network availability - displayName: network availability,network info,network information,network availability info,network availability information,network info availability,network information availability,network availability info href: networking/network-info.md + displayName: network availability,network info,network information,network availability info,network availability information,network info availability,network information availability,network availability info - name: IPv6 overview - displayName: ipv6,ipv href: networking/ipv6-overview.md + displayName: ipv6,ipv - name: Telemetry - displayName: networking telemetry href: networking/networking-telemetry.md + displayName: networking telemetry - name: HTTP items: - name: HTTP support - displayName: networking,http,web services,httpclient href: networking/http/http-overview.md + displayName: networking,http,web services,httpclient - name: HTTP client guidelines - displayName: networking, httpclient href: networking/http/httpclient-guidelines.md + displayName: networking, httpclient - name: Make HTTP requests - displayName: networking,http,web services,client href: networking/http/httpclient.md + displayName: networking,http,web services,client - name: IHttpClientFactory - displayName: networking,httpclient,http,dependency injection,client,factory,named client,named httpclient,typed client,typed httpclient href: ../core/extensions/httpclient-factory.md + displayName: networking,httpclient,http,dependency injection,client,factory,named client,named httpclient,typed client,typed httpclient - name: HTTP/3 with .NET - displayName: networking,http,http3,http/3,http3 with .net,http/3 with .net href: ../core/extensions/httpclient-http3.md + displayName: networking,http,http3,http/3,http3 with .net,http/3 with .net - name: Rate limit an HTTP handler - displayName: networking,http,rate limit,rate limiting,rate limit http,rate limiting http,rate limit http handler,rate limiting http handler href: ../core/extensions/http-ratelimiter.md + displayName: networking,http,rate limit,rate limiting,rate limit http,rate limiting http,rate limit http handler,rate limiting http handler - name: Sockets items: - name: Sockets support - displayName: networking,sockets,socket,socket programming,socket client,socket server href: networking/sockets/sockets-overview.md - - name: Use Sockets to send and receive data over TCP displayName: networking,sockets,socket,socket programming,socket client,socket server + - name: Use Sockets to send and receive data over TCP href: networking/sockets/socket-services.md + displayName: networking,sockets,socket,socket programming,socket client,socket server - name: Use TcpClient and TcpListener - displayName: networking,tcp,tcp listener,tcp client href: networking/sockets/tcp-classes.md + displayName: networking,tcp,tcp listener,tcp client - name: WebSockets items: - name: WebSockets support - displayName: websockets,websocket,websocket programming,websocket client,websocket server href: networking/websockets.md + displayName: websockets,websocket,websocket programming,websocket client,websocket server - name: Security items: - - name: TLS/SSL best practices - displayName: tls,ssl,sslstream,sslstream best practices,tls best practices,ssl best practices - href: ../core/extensions/sslstream-best-practices.md - - name: Troubleshoot SslStream authentication issues - displayName: tls,ssl,sslstream,sslstream troubleshooting,tls troubleshooting,ssl troubleshooting - href: ../core/extensions/sslstream-troubleshooting.md - - name: Migrate from .NET Framework to .NET - href: ../core/extensions/sslstream-migration-from-framework.md + - name: TLS/SSL best practices + href: ../core/extensions/sslstream-best-practices.md + displayName: tls,ssl,sslstream,sslstream best practices,tls best practices,ssl best practices + - name: Troubleshoot SslStream authentication issues + href: ../core/extensions/sslstream-troubleshooting.md + displayName: tls,ssl,sslstream,sslstream troubleshooting,tls troubleshooting,ssl troubleshooting + - name: Migrate from .NET Framework to .NET + href: ../core/extensions/sslstream-migration-from-framework.md - name: QUIC items: - name: QUIC support href: networking/quic/quic-overview.md - name: File globbing - displayName: file globbing,globbing,globbing patterns,globbing pattern,globbing href: ../core/extensions/file-globbing.md + displayName: file globbing,globbing,globbing patterns,globbing pattern,globbing - name: Primitives library - displayName: primitives,primitive types,ichangetoken,change notifications,string tokenizers,StringSegment,StringTokenizer,StringValues href: ../core/extensions/primitives.md + displayName: primitives,primitive types,ichangetoken,change notifications,string tokenizers,StringSegment,StringTokenizer,StringValues - name: Globalization and localization items: - name: Overview - displayName: globalization,localization,culture,localization and globalization href: ../core/extensions/globalization-and-localization.md + displayName: globalization,localization,culture,localization and globalization - name: Globalization - displayName: globalization,culture href: ../core/extensions/globalization.md + displayName: globalization,culture - name: Globalization and ICU - displayName: globalization,icu,culture href: ../core/extensions/globalization-icu.md + displayName: globalization,icu,culture - name: Localizability review - displayName: localizability,localization,localization review,localizability review href: ../core/extensions/localizability-review.md + displayName: localizability,localization,localization review,localizability review - name: Localization - displayName: localization,localization review,localizability review href: ../core/extensions/localization.md + displayName: localization,localization review,localizability review - name: Culture-insensitive string operations items: - name: Overview @@ -917,8 +938,8 @@ items: - name: Create a Windows Service using BackgroundService href: ../core/extensions/windows-service.md - name: Create a Windows Service installer - displayName: msi,windows service installer,setup.exe href: ../core/extensions/windows-service-with-installer.md + displayName: msi,windows service installer,setup.exe - name: Implement the IHostedService interface href: ../core/extensions/timer-service.md - name: Deploy a Worker Service to Azure @@ -935,76 +956,76 @@ items: href: ../standard/managed-execution-process.md - name: Assemblies items: - - name: Overview - displayName: assembly,assemblies - href: ../standard/assembly/index.md - - name: Assembly contents - href: ../standard/assembly/contents.md - - name: Manifest - href: ../standard/assembly/manifest.md - - name: Security considerations - href: ../standard/assembly/security-considerations.md - - name: Versioning - href: ../standard/assembly/versioning.md - - name: Side-by-side execution - href: ../standard/assembly/side-by-side-execution.md - - name: Assembly file format - href: ../standard/assembly/file-format.md - - name: Unloadability in .NET Core - href: ../standard/assembly/unloadability.md - - name: Learn about reference assemblies - href: ../standard/assembly/reference-assemblies.md - - name: Resolve assembly loads - href: ../standard/assembly/resolve-loads.md - - name: Create assemblies - href: ../standard/assembly/create.md - - name: Assembly names - href: ../standard/assembly/names.md - - name: Find an assembly's fully qualified name - href: ../standard/assembly/find-fully-qualified-name.md - - name: Assembly location - href: ../standard/assembly/location.md - - name: Set assembly attributes - href: ../standard/assembly/set-attributes.md - - name: Strong-named assemblies - items: - - name: Overview - href: ../standard/assembly/strong-named.md - - name: Create and use strong-named assemblies - href: ../standard/assembly/create-use-strong-named.md - - name: Create a public-private key pair - href: ../standard/assembly/create-public-private-key-pair.md - - name: Sign an assembly with a strong name - href: ../standard/assembly/sign-strong-name.md - - name: Enhanced strong naming - href: ../standard/assembly/enhanced-strong-naming.md - - name: Reference a strong-named assembly - href: ../standard/assembly/reference-strong-named.md - - name: Disable strong-name bypass - href: ../standard/assembly/disable-strong-name-bypass-feature.md - - name: Delay-sign an assembly - href: ../standard/assembly/delay-sign.md - - name: View assembly contents - href: ../standard/assembly/view-contents.md - - name: Type forwarding in the CLR - href: ../standard/assembly/type-forwarding.md - - name: Friend assemblies - items: - name: Overview - displayName: friend assembly,friend assemblies - href: ../standard/assembly/friend.md - - name: Create unsigned friend assemblies - href: ../standard/assembly/create-unsigned-friend.md - - name: Create signed friend assemblies - href: ../standard/assembly/create-signed-friend.md - - name: Determine if a file is an assembly - href: ../standard/assembly/identify.md - - name: Load and unload assemblies - href: ../standard/assembly/load-unload.md - - name: Embed types from managed assemblies in Visual Studio - href: ../standard/assembly/embed-types-visual-studio.md - - name: Inspect assembly contents using MetadataLoadContext - href: ../standard/assembly/inspect-contents-using-metadataloadcontext.md + displayName: assembly,assemblies + href: ../standard/assembly/index.md + - name: Assembly contents + href: ../standard/assembly/contents.md + - name: Manifest + href: ../standard/assembly/manifest.md + - name: Security considerations + href: ../standard/assembly/security-considerations.md + - name: Versioning + href: ../standard/assembly/versioning.md + - name: Side-by-side execution + href: ../standard/assembly/side-by-side-execution.md + - name: Assembly file format + href: ../standard/assembly/file-format.md + - name: Unloadability in .NET Core + href: ../standard/assembly/unloadability.md + - name: Learn about reference assemblies + href: ../standard/assembly/reference-assemblies.md + - name: Resolve assembly loads + href: ../standard/assembly/resolve-loads.md + - name: Create assemblies + href: ../standard/assembly/create.md + - name: Assembly names + href: ../standard/assembly/names.md + - name: Find an assembly's fully qualified name + href: ../standard/assembly/find-fully-qualified-name.md + - name: Assembly location + href: ../standard/assembly/location.md + - name: Set assembly attributes + href: ../standard/assembly/set-attributes.md + - name: Strong-named assemblies + items: + - name: Overview + href: ../standard/assembly/strong-named.md + - name: Create and use strong-named assemblies + href: ../standard/assembly/create-use-strong-named.md + - name: Create a public-private key pair + href: ../standard/assembly/create-public-private-key-pair.md + - name: Sign an assembly with a strong name + href: ../standard/assembly/sign-strong-name.md + - name: Enhanced strong naming + href: ../standard/assembly/enhanced-strong-naming.md + - name: Reference a strong-named assembly + href: ../standard/assembly/reference-strong-named.md + - name: Disable strong-name bypass + href: ../standard/assembly/disable-strong-name-bypass-feature.md + - name: Delay-sign an assembly + href: ../standard/assembly/delay-sign.md + - name: View assembly contents + href: ../standard/assembly/view-contents.md + - name: Type forwarding in the CLR + href: ../standard/assembly/type-forwarding.md + - name: Friend assemblies + items: + - name: Overview + displayName: friend assembly,friend assemblies + href: ../standard/assembly/friend.md + - name: Create unsigned friend assemblies + href: ../standard/assembly/create-unsigned-friend.md + - name: Create signed friend assemblies + href: ../standard/assembly/create-signed-friend.md + - name: Determine if a file is an assembly + href: ../standard/assembly/identify.md + - name: Load and unload assemblies + href: ../standard/assembly/load-unload.md + - name: Embed types from managed assemblies in Visual Studio + href: ../standard/assembly/embed-types-visual-studio.md + - name: Inspect assembly contents using MetadataLoadContext + href: ../standard/assembly/inspect-contents-using-metadataloadcontext.md - name: Metadata and self-describing components href: ../standard/metadata-and-self-describing-components.md - name: Dependency loading diff --git a/docs/standard/serialization/how-to-chunk-serialized-data.md b/docs/standard/serialization/how-to-chunk-serialized-data.md new file mode 100644 index 0000000000000..1a4e9a29df878 --- /dev/null +++ b/docs/standard/serialization/how-to-chunk-serialized-data.md @@ -0,0 +1,59 @@ +--- +title: "How to: chunk serialized data" +description: You can chunk data to avoid problems with large datasets. Implement the IXmlSerializable interface to control serialization and deserialization. +ms.date: "03/30/2017" +dev_langs: + - "csharp" + - "vb" +helpviewer_keywords: + - "chunking serialized data" + - "data chunking" + - "binary serialization, chunking data" + - "large data set chunking" + - "serialization, chunking data" + - "serialization, examples" + - "binary serialization, examples" +ms.assetid: 22f1b818-7e0d-428a-8680-f17d6ebdd185 +--- +# How to: chunk serialized data + +[!INCLUDE [binary-serialization-warning](../../../includes/binary-serialization-warning.md)] + +Two issues that occur when sending large data sets in Web service messages are: + +1. A large working set (memory) due to buffering by the serialization engine. + +2. Inordinate bandwidth consumption due to 33 percent inflation after Base64 encoding. + + To solve these problems, implement the interface to control the serialization and deserialization. Specifically, implement the and methods to chunk the data. + +### To implement server-side chunking + +1. On the server machine, the Web method must turn off ASP.NET buffering and return a type that implements . + +2. The type that implements chunks the data in the method. + +### To implement client-side processing + +1. Alter the Web method on the client proxy to return the type that implements . You can use a to do this automatically, but this isn't shown here. + +2. Implement the method to read the chunked data stream and write the bytes to disk. This implementation also raises progress events that can be used by a graphic control, such as a progress bar. + +## Example + +The following code example shows the Web method on the client that turns off ASP.NET buffering. It also shows the client-side implementation of the interface that chunks the data in the method. + +[!code-csharp[HowToChunkSerializedData#1](../../../samples/snippets/csharp/VS_Snippets_Remoting/HowToChunkSerializedData/CS/SerializationChunk.cs#1)] +[!code-vb[HowToChunkSerializedData#1](../../../samples/snippets/visualbasic/VS_Snippets_Remoting/HowToChunkSerializedData/VB/SerializationChunk.vb#1)] +[!code-csharp[HowToChunkSerializedData#2](../../../samples/snippets/csharp/VS_Snippets_Remoting/HowToChunkSerializedData/CS/SerializationChunk.cs#2)] +[!code-vb[HowToChunkSerializedData#2](../../../samples/snippets/visualbasic/VS_Snippets_Remoting/HowToChunkSerializedData/VB/SerializationChunk.vb#2)] +[!code-csharp[HowToChunkSerializedData#3](../../../samples/snippets/csharp/VS_Snippets_Remoting/HowToChunkSerializedData/CS/SerializationChunk.cs#3)] +[!code-vb[HowToChunkSerializedData#3](../../../samples/snippets/visualbasic/VS_Snippets_Remoting/HowToChunkSerializedData/VB/SerializationChunk.vb#3)] + +## Compiling the code + +- The code uses the following namespaces: , , , , , , and . + +## See also + +- [Custom Serialization](custom-serialization.md) From 1c40035955a6c2e29f2ac7cc52399a2c4de950ac Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Fri, 31 Mar 2023 17:07:59 -0700 Subject: [PATCH 3/5] automatic link fix up --- .openpublishing.redirection.csharp.json | 2 +- .openpublishing.redirection.standard.json | 12 ++++++------ .../maui/mvvm-community-toolkit-features.md | 2 +- docs/core/compatibility/unsupported-apis.md | 4 ++-- .../concepts/linq/filtering-data.md | 2 +- .../concepts/linq/linq-to-objects.md | 2 +- .../adonet/sql/linq/sql-clr-type-mapping.md | 2 +- .../serialization-and-deserialization.md | 4 ++-- ...version-tolerant-serialization-callbacks.md | 2 +- .../code-analysis/quality-rules/ca1801.md | 2 +- docs/fundamentals/toc.yml | 18 +++++++++--------- .../host/configuration-guide/serialization.md | 2 +- .../how-to-chunk-serialized-data.md | 2 +- docs/standard/serialization/index.md | 2 +- .../introducing-xml-serialization.md | 2 +- .../serialization/system-text-json/how-to.md | 2 +- .../xml-and-soap-serialization.md | 2 +- docs/whats-new/dotnet-7-docs.md | 2 +- 18 files changed, 33 insertions(+), 33 deletions(-) diff --git a/.openpublishing.redirection.csharp.json b/.openpublishing.redirection.csharp.json index 28bcf3fe9e3e2..a36b854767723 100644 --- a/.openpublishing.redirection.csharp.json +++ b/.openpublishing.redirection.csharp.json @@ -3144,7 +3144,7 @@ }, { "source_path_from_root": "/docs/csharp/whats-new/tutorials/mixins-with-default-interface-methods.md", - "redirect_url": "/dotnet/csharp/tutorials/mixins-with-default-interface-methods" + "redirect_url": "/dotnet/csharp/advanced-topics/interface-implementation/mixins-with-default-interface-methods" }, { "source_path_from_root": "/docs/csharp/whats-new/tutorials/nullable-reference-types.md", diff --git a/.openpublishing.redirection.standard.json b/.openpublishing.redirection.standard.json index 0b5d8648b67cb..ba0415e9cdc1b 100644 --- a/.openpublishing.redirection.standard.json +++ b/.openpublishing.redirection.standard.json @@ -583,15 +583,15 @@ }, { "source_path_from_root": "/docs/standard/serialization/marshal-by-value.md", - "redirect_url": "/dotnet/standard/serialization/serialization-concepts" + "redirect_url": "/previous-versions/dotnet/fundamentals/serialization/serialization-concepts" }, { "source_path_from_root": "/docs/standard/serialization/persistent-storage.md", - "redirect_url": "/dotnet/standard/serialization/serialization-concepts" + "redirect_url": "/previous-versions/dotnet/fundamentals/serialization/serialization-concepts" }, { "source_path_from_root": "/docs/standard/serialization/samples-binary.md", - "redirect_url": "/dotnet/standard/serialization/binary-serialization" + "redirect_url": "/previous-versions/dotnet/fundamentals/serialization/binary/binary-serialization" }, { "source_path_from_root": "/docs/standard/serialization/samples-xml.md", @@ -599,7 +599,7 @@ }, { "source_path_from_root": "/docs/standard/serialization/schemaimporterextension-technology-sample.md", - "redirect_url": "/dotnet/standard/serialization/binary-serialization" + "redirect_url": "/previous-versions/dotnet/fundamentals/serialization/binary/binary-serialization" }, { "source_path_from_root": "/docs/standard/serialization/serialization-how-to-topics.md", @@ -615,11 +615,11 @@ }, { "source_path_from_root": "/docs/standard/serialization/version-tolerant-serialization-technology-sample.md", - "redirect_url": "/dotnet/standard/serialization/binary-serialization" + "redirect_url": "/previous-versions/dotnet/fundamentals/serialization/binary/binary-serialization" }, { "source_path_from_root": "/docs/standard/serialization/web-services-generics-serialization-technology-sample.md", - "redirect_url": "/dotnet/standard/serialization/binary-serialization" + "redirect_url": "/previous-versions/dotnet/fundamentals/serialization/binary/binary-serialization" }, { "source_path_from_root": "/docs/standard/serialization/web-services-ixmlserializable-technology-sample.md", diff --git a/docs/architecture/maui/mvvm-community-toolkit-features.md b/docs/architecture/maui/mvvm-community-toolkit-features.md index 70b397ed1cbe1..ccbc3fb6105cd 100644 --- a/docs/architecture/maui/mvvm-community-toolkit-features.md +++ b/docs/architecture/maui/mvvm-community-toolkit-features.md @@ -115,7 +115,7 @@ For more detailed information on implementing commands, see the section [Impleme ## Source Generators -Using the MVVM Toolkit components out-of-the-box allows you to greatly simplify our ViewModel. The MVVM Toolkit allows you to simplify common code use cases even further by using [Source Generators](/dotnet/csharp/roslyn-sdk/source-generators-overview). The MVVM Toolkit source generators look for specific attributes in our code and can generate wrappers for properties and commands. +Using the MVVM Toolkit components out-of-the-box allows you to greatly simplify our ViewModel. The MVVM Toolkit allows you to simplify common code use cases even further by using [Source Generators](../../csharp/roslyn-sdk/source-generators-overview.md). The MVVM Toolkit source generators look for specific attributes in our code and can generate wrappers for properties and commands. > [!IMPORTANT] > The MVVM Toolkit Source Generators generate code that is additive to our existing objects. Because of this, any object that is leveraging a source generator will need to be marked as `partial`. diff --git a/docs/core/compatibility/unsupported-apis.md b/docs/core/compatibility/unsupported-apis.md index ddf449afd4ffe..24f5a8984132b 100644 --- a/docs/core/compatibility/unsupported-apis.md +++ b/docs/core/compatibility/unsupported-apis.md @@ -13,7 +13,7 @@ This article organizes the affected APIs by namespace. > [!NOTE] > > - This article is a work-in-progress. It is not a complete list of APIs that throw exceptions on .NET 5+. -> - This article does not include the explicit interface implementations for binary serialization that throw on .NET 5+. For more information, see [Binary serialization in .NET Core](../../standard/serialization/binary-serialization.md#net-core). +> - This article does not include the explicit interface implementations for binary serialization that throw on .NET 5+. For more information, see [Binary serialization in .NET Core](/previous-versions/dotnet/fundamentals/serialization/binary/binary-serialization#net-core). ## System @@ -342,5 +342,5 @@ This article organizes the affected APIs by namespace. ## See also - [Breaking changes for migration from .NET Framework to .NET Core](fx-core.md) -- [Binary serialization in .NET Core](../../standard/serialization/binary-serialization.md#net-core) +- [Binary serialization in .NET Core](/previous-versions/dotnet/fundamentals/serialization/binary/binary-serialization#net-core) - [.NET portability analyzer](../../standard/analyzers/portability-analyzer.md) diff --git a/docs/csharp/programming-guide/concepts/linq/filtering-data.md b/docs/csharp/programming-guide/concepts/linq/filtering-data.md index 7973bf74fd4b3..86e1f09c3e269 100644 --- a/docs/csharp/programming-guide/concepts/linq/filtering-data.md +++ b/docs/csharp/programming-guide/concepts/linq/filtering-data.md @@ -48,6 +48,6 @@ foreach (string str in query) - [Standard Query Operators Overview (C#)](./standard-query-operators-overview.md) - [where clause](../../../language-reference/keywords/where-clause.md) - [Dynamically specify predicate filters at run time](../../../linq/dynamically-specify-predicate-filters-at-runtime.md) -- [How to query an assembly's metadata with Reflection (LINQ) (C#)](/dotnet/csharp/advanced-topics/reflection-and-attributes/how-to-query-assembly-metadata-with-reflection-linq) +- [How to query an assembly's metadata with Reflection (LINQ) (C#)](../../../advanced-topics/reflection-and-attributes/how-to-query-assembly-metadata-with-reflection-linq.md) - [How to query for files with a specified attribute or name (C#)](./how-to-query-for-files-with-a-specified-attribute-or-name.md) - [How to sort or filter text data by any word or field (LINQ) (C#)](./how-to-sort-or-filter-text-data-by-any-word-or-field-linq.md) diff --git a/docs/csharp/programming-guide/concepts/linq/linq-to-objects.md b/docs/csharp/programming-guide/concepts/linq/linq-to-objects.md index d0672bf10bce4..6ca8579b0ad36 100644 --- a/docs/csharp/programming-guide/concepts/linq/linq-to-objects.md +++ b/docs/csharp/programming-guide/concepts/linq/linq-to-objects.md @@ -27,7 +27,7 @@ The term "LINQ to Objects" refers to the use of LINQ queries with any interface, you can serialize an object to any SQL binary field (`BINARY`, `VARBINARY`, `IMAGE`). The object is serialized and deserialized according to how the interface is implemented. For more information, see [Binary Serialization](../../../../../standard/serialization/binary-serialization.md). + If a class implements the interface, you can serialize an object to any SQL binary field (`BINARY`, `VARBINARY`, `IMAGE`). The object is serialized and deserialized according to how the interface is implemented. For more information, see [Binary Serialization](/previous-versions/dotnet/fundamentals/serialization/binary/binary-serialization). diff --git a/docs/framework/wcf/feature-details/serialization-and-deserialization.md b/docs/framework/wcf/feature-details/serialization-and-deserialization.md index beb9817f40a52..6ff26173493b0 100644 --- a/docs/framework/wcf/feature-details/serialization-and-deserialization.md +++ b/docs/framework/wcf/feature-details/serialization-and-deserialization.md @@ -271,7 +271,7 @@ Windows Communication Foundation (WCF) includes a new serialization engine, the - The and methods are aliases for the and methods. These exist to provide a more consistent programming model with binary or SOAP serialization. - For more information about these features, see [Binary Serialization](../../../standard/serialization/binary-serialization.md). + For more information about these features, see [Binary Serialization](/previous-versions/dotnet/fundamentals/serialization/binary/binary-serialization). The XML formats that the `NetDataContractSerializer` and the `DataContractSerializer` use are normally not compatible. That is, attempting to serialize with one of these serializers and deserialize with the other is not a supported scenario. @@ -282,5 +282,5 @@ Windows Communication Foundation (WCF) includes a new serialization engine, the - - - -- [Binary Serialization](../../../standard/serialization/binary-serialization.md) +- [Binary Serialization](/previous-versions/dotnet/fundamentals/serialization/binary/binary-serialization) - [Types Supported by the Data Contract Serializer](types-supported-by-the-data-contract-serializer.md) diff --git a/docs/framework/wcf/feature-details/version-tolerant-serialization-callbacks.md b/docs/framework/wcf/feature-details/version-tolerant-serialization-callbacks.md index fa6af7c59faf5..2c3eba28bdb8a 100644 --- a/docs/framework/wcf/feature-details/version-tolerant-serialization-callbacks.md +++ b/docs/framework/wcf/feature-details/version-tolerant-serialization-callbacks.md @@ -46,4 +46,4 @@ The data contract programming model fully supports the version-tolerant serializ - - - -- [Version Tolerant Serialization](../../../standard/serialization/version-tolerant-serialization.md) +- [Version Tolerant Serialization](/previous-versions/dotnet/fundamentals/serialization/binary/version-tolerant-serialization) diff --git a/docs/fundamentals/code-analysis/quality-rules/ca1801.md b/docs/fundamentals/code-analysis/quality-rules/ca1801.md index 58873b548b1db..10be2353c45bb 100644 --- a/docs/fundamentals/code-analysis/quality-rules/ca1801.md +++ b/docs/fundamentals/code-analysis/quality-rules/ca1801.md @@ -31,7 +31,7 @@ This rule does not examine the following kinds of methods: - Methods used as event handlers. -- Serialization constructors (see [guidelines](../../../standard/serialization/serialization-guidelines.md#runtime-serialization)). +- Serialization constructors (see [guidelines](/previous-versions/dotnet/fundamentals/serialization/serialization-guidelines#runtime-serialization)). - Serialization methods. diff --git a/docs/fundamentals/toc.yml b/docs/fundamentals/toc.yml index 7a982e78082f5..46ea831d92513 100644 --- a/docs/fundamentals/toc.yml +++ b/docs/fundamentals/toc.yml @@ -588,26 +588,26 @@ items: - name: Binary serialization items: - name: Overview - href: ../standard/serialization/binary-serialization.md + href: /previous-versions/dotnet/fundamentals/serialization/binary/binary-serialization displayName: binary serialization - name: BinaryFormatter security guide href: ../standard/serialization/binaryformatter-security-guide.md - name: BinaryFormatter event source - href: ../standard/serialization/binaryformatter-event-source.md + href: /previous-versions/dotnet/fundamentals/serialization/binary/binaryformatter-event-source - name: Serialization concepts - href: ../standard/serialization/serialization-concepts.md + href: /previous-versions/dotnet/fundamentals/serialization/serialization-concepts - name: Basic serialization - href: ../standard/serialization/basic-serialization.md + href: /previous-versions/dotnet/fundamentals/serialization/basic-serialization - name: Selective serialization - href: ../standard/serialization/selective-serialization.md + href: /previous-versions/dotnet/fundamentals/serialization/binary/selective-serialization - name: Custom serialization - href: ../standard/serialization/custom-serialization.md + href: /previous-versions/dotnet/fundamentals/serialization/binary/custom-serialization - name: Steps in the serialization process - href: ../standard/serialization/steps-in-the-serialization-process.md + href: /previous-versions/dotnet/fundamentals/serialization/binary/steps-in-the-serialization-process - name: Version-tolerant serialization - href: ../standard/serialization/version-tolerant-serialization.md + href: /previous-versions/dotnet/fundamentals/serialization/binary/version-tolerant-serialization - name: Serialization guidelines - href: ../standard/serialization/serialization-guidelines.md + href: /previous-versions/dotnet/fundamentals/serialization/serialization-guidelines - name: "How to: Chunk serialized data" href: ../standard/serialization/how-to-chunk-serialized-data.md - name: XML and SOAP serialization diff --git a/docs/orleans/host/configuration-guide/serialization.md b/docs/orleans/host/configuration-guide/serialization.md index 2bb914bd6b057..5b6a586b996ce 100644 --- a/docs/orleans/host/configuration-guide/serialization.md +++ b/docs/orleans/host/configuration-guide/serialization.md @@ -324,7 +324,7 @@ The is the default fallba ## Exception serialization -Exceptions are serialized using the [fallback serializer](serialization.md#fallback-serialization). Using the default configuration, `BinaryFormatter` is the fallback serializer and so the [ISerializable pattern](../../../standard/serialization/custom-serialization.md) must be followed in order to ensure correct serialization of all properties in an exception type. +Exceptions are serialized using the [fallback serializer](serialization.md#fallback-serialization). Using the default configuration, `BinaryFormatter` is the fallback serializer and so the [ISerializable pattern](/previous-versions/dotnet/fundamentals/serialization/binary/custom-serialization) must be followed in order to ensure correct serialization of all properties in an exception type. Here is an example of an exception type with correctly implemented serialization: diff --git a/docs/standard/serialization/how-to-chunk-serialized-data.md b/docs/standard/serialization/how-to-chunk-serialized-data.md index 1a4e9a29df878..55d9ba84457ba 100644 --- a/docs/standard/serialization/how-to-chunk-serialized-data.md +++ b/docs/standard/serialization/how-to-chunk-serialized-data.md @@ -56,4 +56,4 @@ The following code example shows the Web method on the client that turns off ASP ## See also -- [Custom Serialization](custom-serialization.md) +- [Custom Serialization](/previous-versions/dotnet/fundamentals/serialization/binary/custom-serialization) diff --git a/docs/standard/serialization/index.md b/docs/standard/serialization/index.md index 8a368cec4491d..9bffd597cf6b9 100644 --- a/docs/standard/serialization/index.md +++ b/docs/standard/serialization/index.md @@ -20,7 +20,7 @@ Serialization is the process of converting the state of an object into a form th - [JSON serialization](system-text-json/overview.md) serializes only public properties and does not preserve type fidelity. JSON is an open standard that is an attractive choice for sharing data across the web. -- [Binary serialization](binary-serialization.md) preserves *type fidelity*, which means that the complete state of the object is recorded and when you deserialize, an exact copy is created. This type of serialization is useful for preserving the state of an object between different invocations of an application. For example, you can share an object between different applications by serializing it to the Clipboard. You can serialize an object to a stream, to a disk, to memory, over the network, and so forth. Remoting uses serialization to pass objects "by value" from one computer or application domain to another. +- [Binary serialization](/previous-versions/dotnet/fundamentals/serialization/binary/binary-serialization) preserves *type fidelity*, which means that the complete state of the object is recorded and when you deserialize, an exact copy is created. This type of serialization is useful for preserving the state of an object between different invocations of an application. For example, you can share an object between different applications by serializing it to the Clipboard. You can serialize an object to a stream, to a disk, to memory, over the network, and so forth. Remoting uses serialization to pass objects "by value" from one computer or application domain to another. - [XML and SOAP serialization](xml-and-soap-serialization.md) serializes only `public` properties and fields and does not preserve type fidelity. This is useful when you want to provide or consume data without restricting the application that uses the data. Because XML is an open standard, it is an attractive choice for sharing data across the Web. SOAP is likewise an open standard, which makes it an attractive choice. diff --git a/docs/standard/serialization/introducing-xml-serialization.md b/docs/standard/serialization/introducing-xml-serialization.md index aacd9aaad2d54..8353f01fc0458 100644 --- a/docs/standard/serialization/introducing-xml-serialization.md +++ b/docs/standard/serialization/introducing-xml-serialization.md @@ -176,7 +176,7 @@ For a complete list of type mappings, see the **DataType** property for any of t - - - [XML and SOAP Serialization](xml-and-soap-serialization.md) -- [Binary Serialization](binary-serialization.md) +- [Binary Serialization](/previous-versions/dotnet/fundamentals/serialization/binary/binary-serialization) - [Serialization](index.md) - - [Examples of XML Serialization](examples-of-xml-serialization.md) diff --git a/docs/standard/serialization/system-text-json/how-to.md b/docs/standard/serialization/system-text-json/how-to.md index a229d04ee25d8..dd691b4ff3a2e 100644 --- a/docs/standard/serialization/system-text-json/how-to.md +++ b/docs/standard/serialization/system-text-json/how-to.md @@ -57,7 +57,7 @@ Imports System.Text.Json.Serialization > [!IMPORTANT] > > - Attributes from the namespace aren't supported by `System.Text.Json`. -> - and the interface aren't supported by `System.Text.Json`. These types are used only for [Binary and XML serialization](../binary-serialization.md). +> - and the interface aren't supported by `System.Text.Json`. These types are used only for [Binary and XML serialization](/previous-versions/dotnet/fundamentals/serialization/binary/binary-serialization). ## How to write .NET objects as JSON (serialize) diff --git a/docs/standard/serialization/xml-and-soap-serialization.md b/docs/standard/serialization/xml-and-soap-serialization.md index dd2dd10979471..b771860e0a6d3 100644 --- a/docs/standard/serialization/xml-and-soap-serialization.md +++ b/docs/standard/serialization/xml-and-soap-serialization.md @@ -23,5 +23,5 @@ To serialize or deserialize objects, use the Date: Fri, 31 Mar 2023 17:16:13 -0700 Subject: [PATCH 4/5] fix redirect --- .openpublishing.redirection.standard.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.openpublishing.redirection.standard.json b/.openpublishing.redirection.standard.json index ba0415e9cdc1b..f8637cab64d7c 100644 --- a/.openpublishing.redirection.standard.json +++ b/.openpublishing.redirection.standard.json @@ -751,7 +751,7 @@ }, { "source_path": "docs/standard/serialization/steps-in-the-serialization-process.md", - "redirect_url": "/previous-versions/dotnet/fundamentals/serialization/binary/steps-in-the-serialization-process", + "redirect_url": "/previous-versions/dotnet/fundamentals/serialization/steps-in-the-serialization-process", "redirect_document_id": false }, { From db98db8b5a5aea22399ea0898af4fb74c9896be4 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Fri, 31 Mar 2023 17:27:04 -0700 Subject: [PATCH 5/5] redo some fixes --- docs/fundamentals/toc.yml | 31 ++++--------------- .../binaryformatter-security-guide.md | 1 + docs/standard/serialization/index.md | 22 +++++++------ 3 files changed, 19 insertions(+), 35 deletions(-) diff --git a/docs/fundamentals/toc.yml b/docs/fundamentals/toc.yml index 46ea831d92513..5b34c025e0aec 100644 --- a/docs/fundamentals/toc.yml +++ b/docs/fundamentals/toc.yml @@ -585,31 +585,6 @@ items: href: ../standard/serialization/system-text-json/converters-how-to.md - name: Customize contracts href: ../standard/serialization/system-text-json/custom-contracts.md - - name: Binary serialization - items: - - name: Overview - href: /previous-versions/dotnet/fundamentals/serialization/binary/binary-serialization - displayName: binary serialization - - name: BinaryFormatter security guide - href: ../standard/serialization/binaryformatter-security-guide.md - - name: BinaryFormatter event source - href: /previous-versions/dotnet/fundamentals/serialization/binary/binaryformatter-event-source - - name: Serialization concepts - href: /previous-versions/dotnet/fundamentals/serialization/serialization-concepts - - name: Basic serialization - href: /previous-versions/dotnet/fundamentals/serialization/basic-serialization - - name: Selective serialization - href: /previous-versions/dotnet/fundamentals/serialization/binary/selective-serialization - - name: Custom serialization - href: /previous-versions/dotnet/fundamentals/serialization/binary/custom-serialization - - name: Steps in the serialization process - href: /previous-versions/dotnet/fundamentals/serialization/binary/steps-in-the-serialization-process - - name: Version-tolerant serialization - href: /previous-versions/dotnet/fundamentals/serialization/binary/version-tolerant-serialization - - name: Serialization guidelines - href: /previous-versions/dotnet/fundamentals/serialization/serialization-guidelines - - name: "How to: Chunk serialized data" - href: ../standard/serialization/how-to-chunk-serialized-data.md - name: XML and SOAP serialization items: - name: Overview @@ -646,6 +621,8 @@ items: href: ../standard/serialization/how-to-serialize-an-object-as-a-soap-encoded-xml-stream.md - name: Override encoded SOAP XML serialization href: ../standard/serialization/how-to-override-encoded-soap-xml-serialization.md + - name: Chunk serialized data + href: ../standard/serialization/how-to-chunk-serialized-data.md - name: XML serialization elements items: - name: system.xml.serialization @@ -664,6 +641,10 @@ items: href: ../standard/serialization/xml-serializer-generator-tool-sgen-exe.md - name: XML Schema Definition tool (Xsd.exe) href: ../standard/serialization/xml-schema-definition-tool-xsd-exe.md + - name: Binary serialization + items: + - name: BinaryFormatter security guide + href: ../standard/serialization/binaryformatter-security-guide.md - name: System.CommandLine items: - name: Overview diff --git a/docs/standard/serialization/binaryformatter-security-guide.md b/docs/standard/serialization/binaryformatter-security-guide.md index 487216d95e864..06a7955083ef2 100644 --- a/docs/standard/serialization/binaryformatter-security-guide.md +++ b/docs/standard/serialization/binaryformatter-security-guide.md @@ -81,6 +81,7 @@ Another scenario is where the data file is stored in cloud storage and automatic ## See also +* [Binary serialization](/previous-versions/dotnet/fundamentals/serialization/binary/binary-serialization) * [YSoSerial.Net](https://github.com/pwntester/ysoserial.net) for research into how adversaries attack apps that utilize `BinaryFormatter`. * General background on deserialization vulnerabilities: * [OWASP: Deserialization of Untrusted Data](https://owasp.org/www-community/vulnerabilities/Deserialization_of_untrusted_data) diff --git a/docs/standard/serialization/index.md b/docs/standard/serialization/index.md index 9bffd597cf6b9..07fb8dda008be 100644 --- a/docs/standard/serialization/index.md +++ b/docs/standard/serialization/index.md @@ -2,7 +2,7 @@ title: "Serialization - .NET" description: This article provides information about .NET serialization technologies, including binary serialization, XML and SOAP serialization, and JSON serialization. ms.date: "09/02/2019" -helpviewer_keywords: +helpviewer_keywords: - "JSON serialization" - "XML serialization, defined" - "binary serialization" @@ -14,15 +14,17 @@ ms.assetid: 4d1111c0-9447-4231-a997-96a2b74b3453 # Serialization in .NET -Serialization is the process of converting the state of an object into a form that can be persisted or transported. The complement of serialization is deserialization, which converts a stream into an object. Together, these processes allow data to be stored and transferred. - -.NET features the following serialization technologies: - +Serialization is the process of converting the state of an object into a form that can be persisted or transported. The complement of serialization is deserialization, which converts a stream into an object. Together, these processes allow data to be stored and transferred. + +.NET features the following serialization technologies: + - [JSON serialization](system-text-json/overview.md) serializes only public properties and does not preserve type fidelity. JSON is an open standard that is an attractive choice for sharing data across the web. - -- [Binary serialization](/previous-versions/dotnet/fundamentals/serialization/binary/binary-serialization) preserves *type fidelity*, which means that the complete state of the object is recorded and when you deserialize, an exact copy is created. This type of serialization is useful for preserving the state of an object between different invocations of an application. For example, you can share an object between different applications by serializing it to the Clipboard. You can serialize an object to a stream, to a disk, to memory, over the network, and so forth. Remoting uses serialization to pass objects "by value" from one computer or application domain to another. - -- [XML and SOAP serialization](xml-and-soap-serialization.md) serializes only `public` properties and fields and does not preserve type fidelity. This is useful when you want to provide or consume data without restricting the application that uses the data. Because XML is an open standard, it is an attractive choice for sharing data across the Web. SOAP is likewise an open standard, which makes it an attractive choice. + +- [XML and SOAP serialization](xml-and-soap-serialization.md) serializes only `public` properties and fields and does not preserve type fidelity. This is useful when you want to provide or consume data without restricting the application that uses the data. Because XML is an open standard, it is an attractive choice for sharing data across the Web. SOAP is likewise an open standard, which makes it an attractive choice. + +- [Binary serialization](/previous-versions/dotnet/fundamentals/serialization/binary/binary-serialization) preserves *type fidelity*, which means that the complete state of the object is recorded and when you deserialize, an exact copy is created. This type of serialization is useful for preserving the state of an object between different invocations of an application. For example, you can share an object between different applications by serializing it to the Clipboard. You can serialize an object to a stream, to a disk, to memory, over the network, and so forth. Remoting uses serialization to pass objects "by value" from one computer or application domain to another. + + [!INCLUDE [binary-serialization-warning](../../../includes/binary-serialization-warning.md)] ## Reference @@ -31,6 +33,6 @@ Contains classes that can be used to serialize objects into JSON format document \ Contains classes that can be used for serializing and deserializing objects. - + \ Contains classes that can be used to serialize objects into XML format documents or streams.