diff --git a/nanoFramework.CoreLibrary.NoReflection/CoreLibrary.NoReflection.nfproj b/nanoFramework.CoreLibrary.NoReflection/CoreLibrary.NoReflection.nfproj index 130979ee..091dba68 100644 --- a/nanoFramework.CoreLibrary.NoReflection/CoreLibrary.NoReflection.nfproj +++ b/nanoFramework.CoreLibrary.NoReflection/CoreLibrary.NoReflection.nfproj @@ -169,6 +169,7 @@ + diff --git a/nanoFramework.CoreLibrary/CoreLibrary.nfproj b/nanoFramework.CoreLibrary/CoreLibrary.nfproj index 25f65143..adb8b013 100644 --- a/nanoFramework.CoreLibrary/CoreLibrary.nfproj +++ b/nanoFramework.CoreLibrary/CoreLibrary.nfproj @@ -167,6 +167,7 @@ + diff --git a/nanoFramework.CoreLibrary/System/AttributeTargets.cs b/nanoFramework.CoreLibrary/System/AttributeTargets.cs index 31d1deb4..9a9b6937 100644 --- a/nanoFramework.CoreLibrary/System/AttributeTargets.cs +++ b/nanoFramework.CoreLibrary/System/AttributeTargets.cs @@ -4,12 +4,16 @@ // See LICENSE file in the project root for full license information. // +using System.Runtime.CompilerServices; + namespace System { /// /// Specifies the application elements on which it is valid to apply an attribute. /// - [Flags, Serializable] + [ExcludeFromStubs] + [Flags] + [Serializable] public enum AttributeTargets { /// diff --git a/nanoFramework.CoreLibrary/System/AttributeUsageAttribute.cs b/nanoFramework.CoreLibrary/System/AttributeUsageAttribute.cs index 1af0c3bf..af7c6189 100644 --- a/nanoFramework.CoreLibrary/System/AttributeUsageAttribute.cs +++ b/nanoFramework.CoreLibrary/System/AttributeUsageAttribute.cs @@ -4,12 +4,16 @@ // See LICENSE file in the project root for full license information. // +using System.Runtime.CompilerServices; + namespace System { /// /// Specifies the usage of another attribute class. This class cannot be inherited. /// - [AttributeUsage(AttributeTargets.Class), Serializable] + [AttributeUsage(AttributeTargets.Class)] + [ExcludeFromStubs] + [Serializable] public sealed class AttributeUsageAttribute : Attribute { internal AttributeTargets _attributeTarget; diff --git a/nanoFramework.CoreLibrary/System/CLSCompliantAttribute.cs b/nanoFramework.CoreLibrary/System/CLSCompliantAttribute.cs index 5ec3b70f..1afa16e8 100644 --- a/nanoFramework.CoreLibrary/System/CLSCompliantAttribute.cs +++ b/nanoFramework.CoreLibrary/System/CLSCompliantAttribute.cs @@ -4,12 +4,16 @@ // See LICENSE file in the project root for full license information. // +using System.Runtime.CompilerServices; + namespace System { /// /// Indicates whether a program element is compliant with the Common Language Specification (CLS). This class cannot be inherited. /// - [AttributeUsage(AttributeTargets.All), Serializable] + [AttributeUsage(AttributeTargets.All)] + [ExcludeFromStubs] + [Serializable] public sealed class CLSCompliantAttribute : Attribute { private bool _compliant; diff --git a/nanoFramework.CoreLibrary/System/ComponentModel/EditorBrowsableAttribute.cs b/nanoFramework.CoreLibrary/System/ComponentModel/EditorBrowsableAttribute.cs index 45362efa..1d6f7acc 100644 --- a/nanoFramework.CoreLibrary/System/ComponentModel/EditorBrowsableAttribute.cs +++ b/nanoFramework.CoreLibrary/System/ComponentModel/EditorBrowsableAttribute.cs @@ -3,6 +3,9 @@ // Portions Copyright (c) Microsoft Corporation. All rights reserved. // See LICENSE file in the project root for full license information. // + +using System.Runtime.CompilerServices; + namespace System.ComponentModel { using System; @@ -30,6 +33,7 @@ public enum EditorBrowsableState /// Specifies that a property or method is viewable in an editor. This class cannot be inherited. /// [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface | AttributeTargets.Delegate)] + [ExcludeFromStubs] #pragma warning disable CS0659 // Type overrides Object.Equals(object o) but does not override Object.GetHashCode() /////////////////////////////////////////////////////////////////////////////////////////////////////// // GetHashCode() implementation is provided by general native function CLR_RT_HeapBlock::GetHashCode // diff --git a/nanoFramework.CoreLibrary/System/DBNull.cs b/nanoFramework.CoreLibrary/System/DBNull.cs index a87821e0..962443a6 100644 --- a/nanoFramework.CoreLibrary/System/DBNull.cs +++ b/nanoFramework.CoreLibrary/System/DBNull.cs @@ -4,12 +4,16 @@ // See LICENSE file in the project root for full license information. // +using System.ComponentModel; +using System.Runtime.CompilerServices; + namespace System { /// /// Represents a nonexistent value. This class cannot be inherited. /// - [ComponentModel.EditorBrowsableAttribute(ComponentModel.EditorBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + [ExcludeFromStubs] public sealed class DBNull { diff --git a/nanoFramework.CoreLibrary/System/Diagnostics/ConditionalAttribute.cs b/nanoFramework.CoreLibrary/System/Diagnostics/ConditionalAttribute.cs index 9a99beaf..cdee8dbc 100644 --- a/nanoFramework.CoreLibrary/System/Diagnostics/ConditionalAttribute.cs +++ b/nanoFramework.CoreLibrary/System/Diagnostics/ConditionalAttribute.cs @@ -4,12 +4,16 @@ // See LICENSE file in the project root for full license information. // +using System.Runtime.CompilerServices; + namespace System.Diagnostics { /// /// Indicates to compilers that a method call or attribute should be ignored unless a specified conditional compilation symbol is defined. /// - [AttributeUsage(AttributeTargets.Method, AllowMultiple = true), Serializable] + [AttributeUsage(AttributeTargets.Method, AllowMultiple = true)] + [ExcludeFromStubs] + [Serializable] public sealed class ConditionalAttribute : Attribute { private readonly String _conditionString; diff --git a/nanoFramework.CoreLibrary/System/Diagnostics/DebuggerAttributes.cs b/nanoFramework.CoreLibrary/System/Diagnostics/DebuggerAttributes.cs index 88222b39..6bcc97fd 100644 --- a/nanoFramework.CoreLibrary/System/Diagnostics/DebuggerAttributes.cs +++ b/nanoFramework.CoreLibrary/System/Diagnostics/DebuggerAttributes.cs @@ -4,6 +4,8 @@ // See LICENSE file in the project root for full license information. // +using System.Runtime.CompilerServices; + namespace System.Diagnostics { using System; @@ -15,7 +17,9 @@ namespace System.Diagnostics /// Designer provided types and members that are not part of the code specifically created by the user can complicate the debugging experience. This attribute suppresses the display of these adjunct types and members in the debugger window and automatically steps through, rather than into, designer provided code. When the debugger encounters this attribute when stepping through user code, the user experience is to not see the designer provided code and to step to the next user-supplied code statement. /// The debugger behaviour when the is present is similar to using a combination of the attribute, which hides the code from the debugger, and the attribute, which tells the debugger to step through, rather than into, the code it is applied to. /// - [Serializable, AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [ExcludeFromStubs] + [Serializable] public sealed class DebuggerStepThroughAttribute : Attribute { /// @@ -30,7 +34,9 @@ public DebuggerStepThroughAttribute() { } /// /// The attribute is used as an escape from the effect of a . When executing within the boundaries of the , designer-provided code is executed as a step-through until the next user supplied code is encountered. When context switches are made on a thread, the next user-supplied code module stepped into may not relate to the code that was in the process of being debugged. To avoid this debugging experience, use the to escape from stepping through code to running code. For example, in Visual Studio 2005, encountering a while stepping through code using the F10 key (or Step Over command) has the same effect as pressing the F5 key or using the Start Debugging command. /// - [Serializable, AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [ExcludeFromStubs] + [Serializable] public sealed class DebuggerStepperBoundaryAttribute : Attribute { /// @@ -45,7 +51,9 @@ public DebuggerStepperBoundaryAttribute() { } /// /// The common language runtime attaches no semantics to this attribute. It is provided for use by source code debuggers. For example, the Visual Studio 2005 debugger does not stop in a method marked with this attribute and does not allow a breakpoint to be set in the method. Other debugger attributes recognized by the Visual Studio 2005 debugger are the and the . /// - [Serializable, AttributeUsage(AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Constructor, Inherited = false)] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Constructor, Inherited = false)] + [ExcludeFromStubs] + [Serializable] public sealed class DebuggerHiddenAttribute : Attribute { /// @@ -61,7 +69,9 @@ public DebuggerHiddenAttribute() { } /// Designer provided types and members that are not part of the code specifically created by the user can complicate the debugging experience. This attribute suppresses the display of these adjunct types and members in the debugger window and automatically steps through, rather than into, designer provided code. When the debugger encounters this attribute when stepping through user code, the user experience is to not see the designer provided code and to step to the next user-supplied code statement. /// The debugger behaviour when the is present is similar to using a combination of the attribute, which hides the code from the debugger, and the attribute, which tells the debugger to step through, rather than into, the code it is applied to. /// - [Serializable, AttributeUsage(AttributeTargets.Class | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Constructor | AttributeTargets.Struct, Inherited = false)] + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Constructor | AttributeTargets.Struct, Inherited = false)] + [ExcludeFromStubs] + [Serializable] public sealed class DebuggerNonUserCodeAttribute : Attribute { /// @@ -233,6 +243,7 @@ public DebuggerBrowsableState State /// /// Available only in mscorlib build with support for System.Reflection. [AttributeUsage(AttributeTargets.Struct | AttributeTargets.Class | AttributeTargets.Assembly, AllowMultiple = true)] + [ExcludeFromStubs] public sealed class DebuggerTypeProxyAttribute : Attribute { private readonly string _typeName; @@ -318,6 +329,7 @@ public string TargetTypeName /// Determines how a class or field is displayed in the debugger variable windows. /// [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Delegate | AttributeTargets.Enum | AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Assembly, AllowMultiple = true)] + [ExcludeFromStubs] public sealed class DebuggerDisplayAttribute : Attribute { private string _name; diff --git a/nanoFramework.CoreLibrary/System/FlagsAttribute.cs b/nanoFramework.CoreLibrary/System/FlagsAttribute.cs index a26bbc25..b64a1740 100644 --- a/nanoFramework.CoreLibrary/System/FlagsAttribute.cs +++ b/nanoFramework.CoreLibrary/System/FlagsAttribute.cs @@ -3,12 +3,17 @@ // Portions Copyright (c) Microsoft Corporation. All rights reserved. // See LICENSE file in the project root for full license information. // + +using System.Runtime.CompilerServices; + namespace System { /// /// Indicates that an enumeration can be treated as a bit field; that is, a set of flags. /// - [AttributeUsage(AttributeTargets.Enum), Serializable] + [AttributeUsage(AttributeTargets.Enum)] + [ExcludeFromStubs] + [Serializable] public class FlagsAttribute : Attribute { } diff --git a/nanoFramework.CoreLibrary/System/NonSerializedAttribute.cs b/nanoFramework.CoreLibrary/System/NonSerializedAttribute.cs index 9bc87970..d3833c93 100644 --- a/nanoFramework.CoreLibrary/System/NonSerializedAttribute.cs +++ b/nanoFramework.CoreLibrary/System/NonSerializedAttribute.cs @@ -4,6 +4,8 @@ // See LICENSE file in the project root for full license information. // +using System.Runtime.CompilerServices; + namespace System { @@ -11,6 +13,7 @@ namespace System /// Indicates that a field of a serializable class should not be serialized. This class cannot be inherited. /// [AttributeUsage(AttributeTargets.Field)] + [ExcludeFromStubs] public sealed class NonSerializedAttribute : Attribute { diff --git a/nanoFramework.CoreLibrary/System/ObsoleteAttribute.cs b/nanoFramework.CoreLibrary/System/ObsoleteAttribute.cs index c9654ab6..bcc03f15 100644 --- a/nanoFramework.CoreLibrary/System/ObsoleteAttribute.cs +++ b/nanoFramework.CoreLibrary/System/ObsoleteAttribute.cs @@ -4,14 +4,16 @@ // See LICENSE file in the project root for full license information. // +using System.Runtime.CompilerServices; + namespace System { /// /// Marks the program elements that are no longer in use. This class cannot be inherited. /// - [Serializable, AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | - AttributeTargets.Interface | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Delegate - , Inherited = false)] + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Constructor | AttributeTargets.Delegate | AttributeTargets.Enum | AttributeTargets.Event |AttributeTargets.Field | AttributeTargets.Interface | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Struct, Inherited = false)] + [ExcludeFromStubs] + [Serializable] public sealed class ObsoleteAttribute : Attribute { private readonly String _message; diff --git a/nanoFramework.CoreLibrary/System/ParamArrayAttribute.cs b/nanoFramework.CoreLibrary/System/ParamArrayAttribute.cs index 18f95880..8d9d667a 100644 --- a/nanoFramework.CoreLibrary/System/ParamArrayAttribute.cs +++ b/nanoFramework.CoreLibrary/System/ParamArrayAttribute.cs @@ -4,12 +4,15 @@ // See LICENSE file in the project root for full license information. // +using System.Runtime.CompilerServices; + namespace System { /// /// Indicates that a method will allow a variable number of arguments in its invocation. This class cannot be inherited. /// [AttributeUsage(AttributeTargets.Parameter)] + [ExcludeFromStubs] public sealed class ParamArrayAttribute : Attribute { /// diff --git a/nanoFramework.CoreLibrary/System/Reflection/AssemblyAttributes.cs b/nanoFramework.CoreLibrary/System/Reflection/AssemblyAttributes.cs index 1ba39007..93f21f8f 100644 --- a/nanoFramework.CoreLibrary/System/Reflection/AssemblyAttributes.cs +++ b/nanoFramework.CoreLibrary/System/Reflection/AssemblyAttributes.cs @@ -4,6 +4,8 @@ // See LICENSE file in the project root for full license information. // +using System.Runtime.CompilerServices; + namespace System.Reflection { using System; @@ -12,6 +14,7 @@ namespace System.Reflection /// Specifies which culture the assembly supports. /// [AttributeUsage(AttributeTargets.Assembly)] + [ExcludeFromStubs] public sealed class AssemblyCultureAttribute : Attribute { private readonly String _culture; @@ -41,6 +44,7 @@ public String Culture /// Specifies the version of the assembly being attributed. /// [AttributeUsage(AttributeTargets.Assembly)] + [ExcludeFromStubs] public sealed class AssemblyVersionAttribute : Attribute { private readonly String _version; @@ -70,6 +74,7 @@ public String Version /// Specifies the name of a file containing the key pair used to generate a strong name. /// [AttributeUsage(AttributeTargets.Assembly)] + [ExcludeFromStubs] public sealed class AssemblyKeyFileAttribute : Attribute { private readonly String _keyFile; @@ -99,6 +104,7 @@ public String KeyFile /// Specifies the name of a key container within the CSP containing the key pair used to generate a strong name. /// [AttributeUsage(AttributeTargets.Assembly)] + [ExcludeFromStubs] public sealed class AssemblyKeyNameAttribute : Attribute { private readonly String _keyName; @@ -128,6 +134,7 @@ public String KeyName /// Specifies that the assembly is not fully signed when created. /// [AttributeUsage(AttributeTargets.Assembly)] + [ExcludeFromStubs] public sealed class AssemblyDelaySignAttribute : Attribute { private readonly bool _delaySign; @@ -160,6 +167,7 @@ public bool DelaySign /// /// Available only in mscorlib build with support for System.Reflection. [AttributeUsage(AttributeTargets.Assembly)] + [ExcludeFromStubs] public sealed class AssemblyFlagsAttribute : Attribute { private readonly AssemblyNameFlags _flags; @@ -203,6 +211,7 @@ public AssemblyFlagsAttribute(AssemblyNameFlags assemblyFlags) /// Instructs a compiler to use a specific version number for the Win32 file version resource. The Win32 file version is not required to be the same as the assembly's version number. /// [AttributeUsage(AttributeTargets.Assembly)] + [ExcludeFromStubs] public sealed class AssemblyFileVersionAttribute : Attribute { private readonly String _version; @@ -238,6 +247,7 @@ public String Version /// This attribute is specific of nanoFramework. /// [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class, Inherited = false)] + [ExcludeFromStubs] public sealed class AssemblyNativeVersionAttribute : Attribute { private readonly String _nativeVersion; diff --git a/nanoFramework.CoreLibrary/System/Reflection/AssemblyReflectionAttributes.cs b/nanoFramework.CoreLibrary/System/Reflection/AssemblyReflectionAttributes.cs index c6fb1810..a7a87d07 100644 --- a/nanoFramework.CoreLibrary/System/Reflection/AssemblyReflectionAttributes.cs +++ b/nanoFramework.CoreLibrary/System/Reflection/AssemblyReflectionAttributes.cs @@ -4,6 +4,8 @@ // See LICENSE file in the project root for full license information. // +using System.Runtime.CompilerServices; + namespace System.Reflection { using System; @@ -12,6 +14,7 @@ namespace System.Reflection /// Defines a copyright custom attribute for an assembly manifest. /// [AttributeUsage(AttributeTargets.Assembly)] + [ExcludeFromStubs] public sealed class AssemblyCopyrightAttribute : Attribute { private readonly String _copyright; @@ -41,6 +44,7 @@ public String Copyright /// Defines a trademark custom attribute for an assembly manifest. /// [AttributeUsage(AttributeTargets.Assembly)] + [ExcludeFromStubs] public sealed class AssemblyTrademarkAttribute : Attribute { private readonly String _trademark; @@ -70,6 +74,7 @@ public String Trademark /// Defines a product name custom attribute for an assembly manifest. /// [AttributeUsage(AttributeTargets.Assembly)] + [ExcludeFromStubs] public sealed class AssemblyProductAttribute : Attribute { private readonly String _product; @@ -99,6 +104,7 @@ public String Product /// Defines a company name custom attribute for an assembly manifest. /// [AttributeUsage(AttributeTargets.Assembly)] + [ExcludeFromStubs] public sealed class AssemblyCompanyAttribute : Attribute { private readonly String _company; @@ -128,6 +134,7 @@ public String Company /// Provides a text description for an assembly. /// [AttributeUsage(AttributeTargets.Assembly)] + [ExcludeFromStubs] public sealed class AssemblyDescriptionAttribute : Attribute { private readonly String _description; @@ -157,6 +164,7 @@ public String Description /// Specifies a description for an assembly. /// [AttributeUsage(AttributeTargets.Assembly)] + [ExcludeFromStubs] public sealed class AssemblyTitleAttribute : Attribute { private readonly String _title; @@ -186,6 +194,7 @@ public String Title /// Specifies the build configuration, such as retail or debug, for an assembly. /// [AttributeUsage(AttributeTargets.Assembly)] + [ExcludeFromStubs] public sealed class AssemblyConfigurationAttribute : Attribute { private readonly String _configuration; @@ -215,6 +224,7 @@ public String Configuration /// Defines a friendly default alias for an assembly manifest. /// [AttributeUsage(AttributeTargets.Assembly)] + [ExcludeFromStubs] public sealed class AssemblyDefaultAliasAttribute : Attribute { private readonly String _defaultAlias; @@ -244,6 +254,7 @@ public String DefaultAlias /// Defines additional version information for an assembly manifest. /// [AttributeUsage(AttributeTargets.Assembly)] + [ExcludeFromStubs] public sealed class AssemblyInformationalVersionAttribute : Attribute { private readonly String _informationalVersion; diff --git a/nanoFramework.CoreLibrary/System/Reflection/BindingFlags.cs b/nanoFramework.CoreLibrary/System/Reflection/BindingFlags.cs index 304b1d29..d2780308 100644 --- a/nanoFramework.CoreLibrary/System/Reflection/BindingFlags.cs +++ b/nanoFramework.CoreLibrary/System/Reflection/BindingFlags.cs @@ -4,6 +4,8 @@ // See LICENSE file in the project root for full license information. // +using System.Runtime.CompilerServices; + #if NANOCLR_REFLECTION namespace System.Reflection @@ -13,7 +15,9 @@ namespace System.Reflection /// Specifies flags that control binding and the way in which the search for members and types is conducted by reflection. /// /// Available only in mscorlib build with support for System.Reflection. - [Flags, Serializable] + [Flags] + [ExcludeFromStubs] + [Serializable] public enum BindingFlags { /// diff --git a/nanoFramework.CoreLibrary/System/Reflection/DefaultMemberAttribute.cs b/nanoFramework.CoreLibrary/System/Reflection/DefaultMemberAttribute.cs index c171b98c..ccb817ae 100644 --- a/nanoFramework.CoreLibrary/System/Reflection/DefaultMemberAttribute.cs +++ b/nanoFramework.CoreLibrary/System/Reflection/DefaultMemberAttribute.cs @@ -4,6 +4,8 @@ // See LICENSE file in the project root for full license information. // +using System.Runtime.CompilerServices; + #if NANOCLR_REFLECTION namespace System.Reflection @@ -14,7 +16,9 @@ namespace System.Reflection /// Defines the member of a type that is the default member used by InvokeMember. /// /// Available only in mscorlib build with support for System.Reflection. - [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Interface), Serializable] + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Interface)] + [ExcludeFromStubs] + [Serializable] public sealed class DefaultMemberAttribute : Attribute { private readonly String _memberName; diff --git a/nanoFramework.CoreLibrary/System/Reflection/FieldReflectionAttributes.cs b/nanoFramework.CoreLibrary/System/Reflection/FieldReflectionAttributes.cs index b196efbe..51ff343c 100644 --- a/nanoFramework.CoreLibrary/System/Reflection/FieldReflectionAttributes.cs +++ b/nanoFramework.CoreLibrary/System/Reflection/FieldReflectionAttributes.cs @@ -4,9 +4,12 @@ // See LICENSE file in the project root for full license information. // +using System.Runtime.CompilerServices; + namespace System.Reflection { [AttributeUsage(AttributeTargets.Field)] + [ExcludeFromStubs] internal sealed class FieldNoReflectionAttribute : Attribute { } diff --git a/nanoFramework.CoreLibrary/System/Reflection/MethodImplAttributes.cs b/nanoFramework.CoreLibrary/System/Reflection/MethodImplAttributes.cs index 0a98d172..8b8ca92c 100644 --- a/nanoFramework.CoreLibrary/System/Reflection/MethodImplAttributes.cs +++ b/nanoFramework.CoreLibrary/System/Reflection/MethodImplAttributes.cs @@ -4,6 +4,8 @@ // See LICENSE file in the project root for full license information. // +using System.Runtime.CompilerServices; + namespace System.Reflection { using System; @@ -11,6 +13,7 @@ namespace System.Reflection /// /// Specifies flags for the attributes of a method implementation. /// + [ExcludeFromStubs] [Serializable] public enum MethodImplAttributes { diff --git a/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/ExcludeFromStubsAttribute.cs b/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/ExcludeFromStubsAttribute.cs new file mode 100644 index 00000000..cf9fcb2b --- /dev/null +++ b/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/ExcludeFromStubsAttribute.cs @@ -0,0 +1,12 @@ +using System; + +namespace System.Runtime.CompilerServices +{ + /// + /// When a class, enum, or struct is marked with it will be excluded from the native stubs generated by .NET nanoFramework metadata processor. + /// + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Struct, AllowMultiple = false, Inherited = true)] + public class ExcludeFromStubsAttribute: Attribute + { + } +} diff --git a/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/IndexerNameAttribute.cs b/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/IndexerNameAttribute.cs index 2ea7e4b6..c01beb1f 100644 --- a/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/IndexerNameAttribute.cs +++ b/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/IndexerNameAttribute.cs @@ -9,7 +9,9 @@ namespace System.Runtime.CompilerServices /// /// Indicates the name by which an indexer is known in programming languages that do not support indexers directly. /// - [Serializable, AttributeUsage(AttributeTargets.Property)] + [AttributeUsage(AttributeTargets.Property)] + [ExcludeFromStubs] + [Serializable] public sealed class IndexerNameAttribute : Attribute { /// diff --git a/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/InternalsVisibleToAttribute.cs b/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/InternalsVisibleToAttribute.cs index da3e5a8e..1990a8ed 100644 --- a/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/InternalsVisibleToAttribute.cs +++ b/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/InternalsVisibleToAttribute.cs @@ -10,6 +10,7 @@ namespace System.Runtime.CompilerServices /// Specifies that types that are ordinarily visible only within the current assembly are visible to a specified assembly. /// [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] + [ExcludeFromStubs] public sealed class InternalsVisibleToAttribute : Attribute { private readonly string _assemblyName; diff --git a/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/MethodImplAttribute.cs b/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/MethodImplAttribute.cs index 00defffa..eb122e5a 100644 --- a/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/MethodImplAttribute.cs +++ b/nanoFramework.CoreLibrary/System/Runtime/CompilerServices/MethodImplAttribute.cs @@ -9,6 +9,7 @@ namespace System.Runtime.CompilerServices /// /// Defines the details of how a method is implemented. /// + [ExcludeFromStubs] [Serializable] public enum MethodImplOptions { @@ -42,6 +43,7 @@ public enum MethodImplOptions /// /// Defines how a method is implemented. /// + [ExcludeFromStubs] [Serializable] public enum MethodCodeType { diff --git a/nanoFramework.CoreLibrary/System/Runtime/InteropServices/Attributes.cs b/nanoFramework.CoreLibrary/System/Runtime/InteropServices/Attributes.cs index 2f543ce7..7beb9512 100644 --- a/nanoFramework.CoreLibrary/System/Runtime/InteropServices/Attributes.cs +++ b/nanoFramework.CoreLibrary/System/Runtime/InteropServices/Attributes.cs @@ -4,12 +4,15 @@ // See LICENSE file in the project root for full license information. // +using System.Runtime.CompilerServices; + namespace System.Runtime.InteropServices { /// /// Controls accessibility of an individual managed type or member, or of all types within an assembly, to COM. /// [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Interface | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Delegate | AttributeTargets.Enum | AttributeTargets.Field | AttributeTargets.Method | AttributeTargets.Property, Inherited = false)] + [ExcludeFromStubs] public sealed class ComVisibleAttribute : Attribute { internal bool _val; @@ -36,6 +39,7 @@ public ComVisibleAttribute(bool visibility) /// Supplies an explicit System.Guid when an automatic GUID is undesirable. /// [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Interface | AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Struct | AttributeTargets.Delegate, Inherited = false)] + [ExcludeFromStubs] public sealed class GuidAttribute : Attribute { internal String Val; @@ -62,6 +66,7 @@ public GuidAttribute(String guid) /// Indicates that data should be marshaled from callee back to caller. /// [AttributeUsage(AttributeTargets.Parameter)] + [ExcludeFromStubs] public sealed class OutAttribute : Attribute { } @@ -70,6 +75,7 @@ public sealed class OutAttribute : Attribute /// Lets you control the physical layout of the data fields of a class or structure in memory. /// [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false)] + [ExcludeFromStubs] public sealed class StructLayoutAttribute : Attribute { internal LayoutKind Val; diff --git a/nanoFramework.CoreLibrary/System/Runtime/InteropServices/CharSet.cs b/nanoFramework.CoreLibrary/System/Runtime/InteropServices/CharSet.cs index 3559023c..01b3d8d9 100644 --- a/nanoFramework.CoreLibrary/System/Runtime/InteropServices/CharSet.cs +++ b/nanoFramework.CoreLibrary/System/Runtime/InteropServices/CharSet.cs @@ -4,11 +4,14 @@ // See LICENSE file in the project root for full license information. // +using System.Runtime.CompilerServices; + namespace System.Runtime.InteropServices { /// /// Dictates which character set marshaled strings should use. /// + [ExcludeFromStubs] [Serializable] public enum CharSet { diff --git a/nanoFramework.CoreLibrary/System/Runtime/InteropServices/LayoutKind.cs b/nanoFramework.CoreLibrary/System/Runtime/InteropServices/LayoutKind.cs index b7dd2704..fbeb0a2d 100644 --- a/nanoFramework.CoreLibrary/System/Runtime/InteropServices/LayoutKind.cs +++ b/nanoFramework.CoreLibrary/System/Runtime/InteropServices/LayoutKind.cs @@ -4,11 +4,14 @@ // See LICENSE file in the project root for full license information. // +using System.Runtime.CompilerServices; + namespace System.Runtime.InteropServices { /// /// Controls the layout of an object when exported to unmanaged code. /// + [ExcludeFromStubs] [Serializable] public enum LayoutKind { diff --git a/nanoFramework.CoreLibrary/System/Runtime/Remoting/__TransparentProxy.cs b/nanoFramework.CoreLibrary/System/Runtime/Remoting/__TransparentProxy.cs index b0a494f6..c6d92f9f 100644 --- a/nanoFramework.CoreLibrary/System/Runtime/Remoting/__TransparentProxy.cs +++ b/nanoFramework.CoreLibrary/System/Runtime/Remoting/__TransparentProxy.cs @@ -4,9 +4,13 @@ // See LICENSE file in the project root for full license information. // +using System.ComponentModel; +using System.Runtime.CompilerServices; + namespace System.Runtime.Remoting.Proxies { - [ComponentModel.EditorBrowsableAttribute(ComponentModel.EditorBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + [ExcludeFromStubs] internal sealed class __TransparentProxy { } diff --git a/nanoFramework.CoreLibrary/System/SerializableAttribute.cs b/nanoFramework.CoreLibrary/System/SerializableAttribute.cs index d8543808..8fde1875 100644 --- a/nanoFramework.CoreLibrary/System/SerializableAttribute.cs +++ b/nanoFramework.CoreLibrary/System/SerializableAttribute.cs @@ -4,12 +4,15 @@ // See LICENSE file in the project root for full license information. // +using System.Runtime.CompilerServices; + namespace System { /// /// Indicates that a class can be serialized. This class cannot be inherited. /// [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Delegate, Inherited = false)] + [ExcludeFromStubs] public sealed class SerializableAttribute : Attribute { } diff --git a/nanoFramework.CoreLibrary/System/ThreadAttributes.cs b/nanoFramework.CoreLibrary/System/ThreadAttributes.cs index d5708d3b..85eb49bb 100644 --- a/nanoFramework.CoreLibrary/System/ThreadAttributes.cs +++ b/nanoFramework.CoreLibrary/System/ThreadAttributes.cs @@ -4,12 +4,15 @@ // See LICENSE file in the project root for full license information. // +using System.Runtime.CompilerServices; + namespace System { /// /// Indicates that the COM threading model for an application is single-threaded apartment (STA). /// [AttributeUsage(AttributeTargets.Method)] + [ExcludeFromStubs] public sealed class STAThreadAttribute : Attribute { /// @@ -24,6 +27,7 @@ public STAThreadAttribute() /// Indicates that the COM threading model for an application is multithreaded apartment (MTA). /// [AttributeUsage(AttributeTargets.Method)] + [ExcludeFromStubs] public sealed class MTAThreadAttribute : Attribute { /// diff --git a/nanoFramework.CoreLibrary/System/TypedReference.cs b/nanoFramework.CoreLibrary/System/TypedReference.cs index 310611e9..28e8f30c 100644 --- a/nanoFramework.CoreLibrary/System/TypedReference.cs +++ b/nanoFramework.CoreLibrary/System/TypedReference.cs @@ -3,13 +3,18 @@ // Portions Copyright (c) Microsoft Corporation. All rights reserved. // See LICENSE file in the project root for full license information. // + +using System.ComponentModel; +using System.Runtime.CompilerServices; + namespace System { /// /// Describes objects that contain both a managed pointer to a location and a runtime representation of the type that may be stored at that location. /// - [ComponentModel.EditorBrowsableAttribute(ComponentModel.EditorBrowsableState.Never)] + [EditorBrowsable(EditorBrowsableState.Never)] + [ExcludeFromStubs] public struct TypedReference { } } diff --git a/nanoFramework.CoreLibrary/System/UIntPtr.cs b/nanoFramework.CoreLibrary/System/UIntPtr.cs index 613d1212..1d20096a 100644 --- a/nanoFramework.CoreLibrary/System/UIntPtr.cs +++ b/nanoFramework.CoreLibrary/System/UIntPtr.cs @@ -4,13 +4,17 @@ // See LICENSE file in the project root for full license information. // +using System.ComponentModel; +using System.Runtime.CompilerServices; + namespace System { /// /// A platform-specific type that is used to represent a pointer or a handle. /// + [EditorBrowsable(EditorBrowsableState.Never)] + [ExcludeFromStubs] [Serializable] - [ComponentModel.EditorBrowsableAttribute(ComponentModel.EditorBrowsableState.Never)] public struct UIntPtr { }