Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 9a72ba2

Browse files
maryamariyandanmoseley
authored andcommitted
Fixing MatchingRefApiCompat issues with Sys.Configuration.ConfigurationManager (#28394)
* Reduced the number of MatchingRefApiCompat errors with Sys.Configuration.ConfigurationManager Fixes: #27973 * Adding comment for the remaining existing two serialization issues * Removing internal interface from ref
1 parent 29b20ca commit 9a72ba2

File tree

5 files changed

+9
-13
lines changed

5 files changed

+9
-13
lines changed

src/System.Configuration.ConfigurationManager/ref/System.Configuration.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1404,10 +1404,12 @@ public virtual void DeleteStream(string streamName) { }
14041404
public virtual System.Type GetConfigType(string typeName, bool throwOnError) { throw null; }
14051405
public virtual string GetConfigTypeName(System.Type t) { throw null; }
14061406
public virtual void GetRestrictedPermissions(IInternalConfigRecord configRecord, out System.Security.PermissionSet permissionSet, out bool isHostReady) { throw null; }
1407-
14081407
public virtual string GetStreamName(string configPath) { throw null; }
14091408
public virtual string GetStreamNameForConfigSource(string streamName, string configSource) { throw null; }
14101409
public virtual object GetStreamVersion(string streamName) { throw null; }
1410+
public virtual bool HasLocalConfig { get; }
1411+
public virtual bool HasRoamingConfig { get; }
1412+
public virtual bool IsAppConfigHttp { get; }
14111413
public virtual System.IDisposable Impersonate() { throw null; }
14121414
public virtual void Init(System.Configuration.Internal.IInternalConfigRoot configRoot, params object[] hostInitParams) { }
14131415
public virtual void InitForConfiguration(ref string locationSubPath, out string configPath, out string locationConfigPath, System.Configuration.Internal.IInternalConfigRoot configRoot, params object[] hostInitConfigurationParams) { configPath = default(string); locationConfigPath = default(string); }
@@ -1427,6 +1429,7 @@ public virtual void Init(System.Configuration.Internal.IInternalConfigRoot confi
14271429
public virtual bool PrefetchAll(string configPath, string streamName) { throw null; }
14281430
public virtual bool PrefetchSection(string sectionGroupName, string sectionName) { throw null; }
14291431
public virtual void RequireCompleteInit(System.Configuration.Internal.IInternalConfigRecord configRecord) { }
1432+
public virtual void RefreshConfigPaths() { }
14301433
public virtual object StartMonitoringStreamForChanges(string streamName, System.Configuration.Internal.StreamChangeCallback callback) { throw null; }
14311434
public virtual void StopMonitoringStreamForChanges(string streamName, System.Configuration.Internal.StreamChangeCallback callback) { }
14321435
public virtual void VerifyDefinitionAllowed(string configPath, System.Configuration.ConfigurationAllowDefinition allowDefinition, System.Configuration.ConfigurationAllowExeDefinition allowExeDefinition, System.Configuration.Internal.IConfigErrorInfo errorInfo) { }
Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
11
Compat issues with assembly System.Configuration.ConfigurationManager:
2-
MembersMustExist : Member 'System.Configuration.ConfigurationSettings..ctor()' does not exist in the implementation but it does exist in the contract.
3-
TypesMustExist : Type 'System.Configuration.DateTimeConfigurationCollection' does not exist in the implementation but it does exist in the contract.
2+
# Cannot remove the serialization constructors because they are needed for serialization
43
MembersMustExist : Member 'System.Configuration.SettingsAttributeDictionary..ctor(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)' does not exist in the implementation but it does exist in the contract.
54
MembersMustExist : Member 'System.Configuration.SettingsContext..ctor(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)' does not exist in the implementation but it does exist in the contract.
6-
CannotRemoveBaseTypeOrInterface : Type 'System.Configuration.Internal.DelegatingConfigHost' does not implement interface 'System.Configuration.Internal.IInternalConfigHostPaths' in the implementation but it does in the contract.
7-
MembersMustExist : Member 'System.Configuration.Internal.DelegatingConfigHost.HasLocalConfig.get()' does not exist in the implementation but it does exist in the contract.
8-
MembersMustExist : Member 'System.Configuration.Internal.DelegatingConfigHost.HasRoamingConfig.get()' does not exist in the implementation but it does exist in the contract.
9-
MembersMustExist : Member 'System.Configuration.Internal.DelegatingConfigHost.IsAppConfigHttp.get()' does not exist in the implementation but it does exist in the contract.
10-
MembersMustExist : Member 'System.Configuration.Internal.DelegatingConfigHost.RefreshConfigPaths()' does not exist in the implementation but it does exist in the contract.
11-
TypesMustExist : Type 'System.Configuration.Internal.IInternalConfigHostPaths' does not exist in the implementation but it does exist in the contract.
12-
Total Issues: 10
5+
Total Issues: 2

src/System.Configuration.ConfigurationManager/src/System/Configuration/ConfigurationSettings.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace System.Configuration
88
{
99
public sealed class ConfigurationSettings
1010
{
11-
public ConfigurationSettings() { }
11+
internal ConfigurationSettings() { }
1212

1313
[Obsolete("This method is obsolete, it has been replaced by System.Configuration!System.Configuration.ConfigurationManager.AppSettings")]
1414
public static NameValueCollection AppSettings

src/System.Configuration.ConfigurationManager/src/System/Configuration/DateTimeConfigurationCollection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
namespace System.Configuration
66
{
77
[ConfigurationCollection(typeof(DateTimeConfigurationElement))]
8-
public sealed class DateTimeConfigurationCollection : ConfigurationElementCollection
8+
internal sealed class DateTimeConfigurationCollection : ConfigurationElementCollection
99
{
1010
private static readonly ConfigurationPropertyCollection s_properties;
1111

src/System.Configuration.ConfigurationManager/src/System/Configuration/Internal/IInternalConfigHostPaths.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
namespace System.Configuration.Internal
88
{
9-
public interface IInternalConfigHostPaths
9+
internal interface IInternalConfigHostPaths
1010
{
1111
void RefreshConfigPaths();
1212
bool HasLocalConfig { get; }

0 commit comments

Comments
 (0)