ConfigurationSection.ShouldSerializeSectionInTargetVersion Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Indique si l’instance ConfigurationSection actuelle doit être sérialisée lorsque la hiérarchie d’objets de configuration est sérialisée pour la version cible spécifiée du framework .NET.
protected public:
virtual bool ShouldSerializeSectionInTargetVersion(System::Runtime::Versioning::FrameworkName ^ targetFramework);
protected:
virtual bool ShouldSerializeSectionInTargetVersion(System::Runtime::Versioning::FrameworkName ^ targetFramework);
protected internal virtual bool ShouldSerializeSectionInTargetVersion(System.Runtime.Versioning.FrameworkName targetFramework);
protected virtual bool ShouldSerializeSectionInTargetVersion(System.Runtime.Versioning.FrameworkName targetFramework);
abstract member ShouldSerializeSectionInTargetVersion : System.Runtime.Versioning.FrameworkName -> bool
override this.ShouldSerializeSectionInTargetVersion : System.Runtime.Versioning.FrameworkName -> bool
Protected Friend Overridable Function ShouldSerializeSectionInTargetVersion (targetFramework As FrameworkName) As Boolean
Protected Overridable Function ShouldSerializeSectionInTargetVersion (targetFramework As FrameworkName) As Boolean
Paramètres
- targetFramework
- FrameworkName
Version cible du framework .NET.
Retours
true si la section actuelle doit être sérialisée ; sinon, false.
Remarques
Chaque section de configuration créée pour les versions .NET Framework 4 et ultérieures doit remplacer explicitement cette méthode et retourner true, mais uniquement si la section de configuration est valide pour la version spécifiée de l’infrastructure .NET. Les sections de configuration existantes qui ont été créées pour les versions antérieures de l’infrastructure .NET n’ont pas besoin d’être modifiées.
Le type de base contient une implémentation par défaut de cette méthode qui retourne truetoujours . Si vous implémentez une section de configuration et que vous ne remplacez pas cette méthode, par défaut, la section de configuration sera sérialisée pour toutes les versions du framework.