.NET Portability Report

Summary

Assembly.NET Framework 4.6ASP.NET 5 1.0Mono 4.5
Castle.Core100%85.9%99.31%
Moq100%93.6%98.86%

Castle.Core

Target type.NET Framework 4.6ASP.NET 5 1.0Mono 4.5Recommended changes
System.ComponentModel.BindingList`1
EndNew(System.Int32)
add_AddingNew(System.ComponentModel.AddingNewEventHandler)
ResetBindings
set_AllowNew(System.Boolean)
add_ListChanged(System.ComponentModel.ListChangedEventHandler)
get_AllowNew
CancelNew(System.Int32)
AddNew
remove_AddingNew(System.ComponentModel.AddingNewEventHandler)
set_AllowEdit(System.Boolean)
set_AllowRemove(System.Boolean)
remove_ListChanged(System.ComponentModel.ListChangedEventHandler)
get_AllowRemove
#ctor
get_RaiseListChangedEvents
#ctor(System.Collections.Generic.IList{`0})
ResetItem(System.Int32)
get_AllowEdit
set_RaiseListChangedEvents(System.Boolean)
     
System.Type.GetTypeInfo().IsNestedAssembly
get_IsNestedAssembly.GetTypeInfo().IsNestedAssembly
get_IsPrimitive.GetTypeInfo().IsPrimitive
get_IsVisible.GetTypeInfo().IsVisible
get_IsPublic.GetTypeInfo().IsPublic
get_IsSerializable.GetTypeInfo().IsSerializable
GetInterfaceMap(System.Type)
get_IsSealed.GetTypeInfo().IsSealed
get_IsInterface.GetTypeInfo().IsInterface
get_IsValueType.GetTypeInfo().IsValueType
get_IsClass.GetTypeInfo().IsClass
get_IsNestedPublic.GetTypeInfo().IsNestedPublic
get_GUID
get_IsNestedFamORAssem.GetTypeInfo().IsNestedFamORAssem
get_IsGenericTypeDefinition.GetTypeInfo().IsGenericTypeDefinition
get_BaseType.GetTypeInfo().BaseType
get_DeclaringMethod
GetGenericParameterConstraints.GetTypeInfo().GetGenericParameterConstraints()
get_IsImport.GetTypeInfo().IsImport
get_Assembly.GetTypeInfo().Assembly
get_UnderlyingSystemType
InvokeMember(System.String,System.Reflection.BindingFlags,System.Reflection.Binder,System.Object,System.Object[])Find member and use appropriate invocation method based off BindingFlags values used in original call (varies by type of member)
get_IsGenericType.GetTypeInfo().IsGenericType
IsSubclassOf(System.Type).GetTypeInfo().IsSubclassOf
GetConstructor(System.Reflection.BindingFlags,System.Reflection.Binder,System.Type[],System.Reflection.ParameterModifier[])Use GetConstructor(Type[]) to search for public constructors by parameter type or filter the results of GetConstructors(BindingFlags) using LINQ for other queries.
GetMethod(System.String,System.Reflection.BindingFlags,System.Reflection.Binder,System.Type[],System.Reflection.ParameterModifier[])Use GetMethod(string, Type[]) to search for public methods by name and parameter type or filter the results of GetMethods(BindingFlags) using LINQ for other queries.
get_ContainsGenericParameters.GetTypeInfo().ContainsGenericParameters
GetInterface(System.String,System.Boolean)Enumerate across TypeInfo.ImplementedInterfaces
get_IsEnum.GetTypeInfo().IsEnum
get_IsAbstract.GetTypeInfo().IsAbstract
get_GenericParameterAttributes
     
System.ComponentModel.IBindingList
get_IsSorted
RemoveIndex(System.ComponentModel.PropertyDescriptor)
RemoveSort
Find(System.ComponentModel.PropertyDescriptor,System.Object)
get_SortDirection
ApplySort(System.ComponentModel.PropertyDescriptor,System.ComponentModel.ListSortDirection)
add_ListChanged(System.ComponentModel.ListChangedEventHandler)
get_SupportsSearching
get_AllowEdit
AddIndex(System.ComponentModel.PropertyDescriptor)
get_SortProperty
get_AllowNew
get_SupportsChangeNotification
AddNew
get_SupportsSorting
get_AllowRemove
     
System.Reflection.PropertyInfoUse PropertyInfo.GetMethod property
GetGetMethodUse PropertyInfo.GetMethod property
GetSetMethodUse PropertyInfo.SetMethod property
GetGetMethod(System.Boolean)Use PropertyInfo.GetMethod property
GetSetMethod(System.Boolean)Use PropertyInfo.SetMethod property
     
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
Serialize(System.IO.Stream,System.Object)
Deserialize(System.IO.Stream)
#ctor
     
System.Diagnostics.EventLog
CreateEventSource(System.Diagnostics.EventSourceCreationData)
get_Log
WriteEntry(System.String,System.Diagnostics.EventLogEntryType)
CreateEventSource(System.String,System.String)
SourceExists(System.String)
get_Source
get_MachineName
#ctor(System.String,System.String,System.String)
#ctor(System.String)
set_Source(System.String)Use EventSource type instead which now supports channels, enabling logging ETW events to the event log. Currently there is no other workaround, but we are working on it. Please check back.
SourceExists(System.String,System.String)
Close
     
System.Security.PermissionSet
AddPermission(System.Security.IPermission)
#ctor(System.Security.Permissions.PermissionState)
IsSubsetOf(System.Security.PermissionSet)
     
System.AttributeUse System.Reflection.CustomAttributeExtensions.IsDefined() in System.Reflection.Extensions
IsDefined(System.Reflection.MemberInfo,System.Type)Use System.Reflection.CustomAttributeExtensions.IsDefined() in System.Reflection.Extensions
GetCustomAttribute(System.Reflection.MemberInfo,System.Type)
     
System.Runtime.Remoting.RemotingServices
IsTransparentProxy(System.Object)
GetRealProxy(System.Object)Remove usage
     
System.SerializableAttributeRemove this attribute
#ctorRemove this attribute
     
System.ComponentModel.ISupportInitialize
BeginInit
EndInit
     
System.Reflection.StrongNameKeyPair
#ctor(System.Byte[])
     
System.NonSerializedAttributeRemove this attribute
#ctorRemove usage
     
System.Reflection.CustomAttributeData
get_Constructor
GetCustomAttributes(System.Reflection.ParameterInfo)
GetCustomAttributes(System.Reflection.MemberInfo)
     
System.Runtime.Serialization.IDeserializationCallback
OnDeserialization(System.Object)
     
System.Runtime.Remoting.IRemotingTypeInfo
CanCastTo(System.Type,System.Object)
     
System.Security.Permissions.SecurityPermissionFlag
     
System.ContextBoundObject
     
System.Net.Mail.MailMessage
Dispose
#ctor(System.String,System.String,System.String,System.String)
     
System.Xml.Xsl.IXsltContextVariable
get_IsParam
get_IsLocal
     
System.Text.EncodingUse GetEncoding(0)
get_DefaultUse GetEncoding(0)
     
System.AppDomainRemove usage
get_CurrentDomainRemove usage
get_BaseDirectoryCurrently there is no workaround, but we are working on it. Please check back.
get_PermissionSet
DefineDynamicAssembly(System.Reflection.AssemblyName,System.Reflection.Emit.AssemblyBuilderAccess)
DefineDynamicAssembly(System.Reflection.AssemblyName,System.Reflection.Emit.AssemblyBuilderAccess,System.String)
     
System.Reflection.Emit.TypeBuilder
CreateType
     
System.ComponentModel.PropertyDescriptorCollection
Find(System.String,System.Boolean)
     
System.Xml.Xsl.XsltContext
ResolveFunction(System.String,System.String,System.Xml.XPath.XPathResultType[])
CompareDocument(System.String,System.String)
get_Whitespace
PreserveWhitespace(System.Xml.XPath.XPathNavigator)
#ctor
ResolveVariable(System.String,System.String)
#ctor(System.Xml.NameTable)
     
System.Diagnostics.Debugger
get_IsAttached
     
System.Diagnostics.EventLogEntryTypeUse EventSource type instead which now supports channels, enabling logging ETW events to the event log. Currently there is no other workaround, but we are working on it. Please check back.
     
System.Security.Permissions.SecurityPermission
#ctor(System.Security.Permissions.SecurityPermissionFlag)
     
System.Reflection.CustomAttributeNamedArgument
get_MemberInfo
     
System.ComponentModel.IDataErrorInfo
get_Item(System.String)
     
System.ComponentModel.AddingNewEventArgs
set_NewObject(System.Object)
     
System.ComponentModel.IRaiseItemChangedEvents
get_RaisesItemChangedEvents
     
System.Configuration.ConfigurationErrorsExceptionUse configuration appropriate for your application model. For portable Framework Components, expose API for configuration on type
#ctor(System.String)
     
System.ArrayUse foreach statement with custom conversion code to handle conversion.
ConvertAll``2(``0[],System.Converter{``0,``1})Use foreach statement with custom conversion code to handle conversion.
AsReadOnly``1(``0[])create a new System.Collections.ObjectModel.ReadOnlyCollection using the Array as arguments
     
System.Net.Mail.SendCompletedEventHandler
#ctor(System.Object,System.IntPtr)
     
System.Net.Mail.SmtpClient
set_Credentials(System.Net.ICredentialsByHost)
remove_SendCompleted(System.Net.Mail.SendCompletedEventHandler)
#ctor
set_Timeout(System.Int32)
Send(System.Net.Mail.MailMessage)
add_SendCompleted(System.Net.Mail.SendCompletedEventHandler)
#ctor(System.String,System.Int32)
set_EnableSsl(System.Boolean)
SendAsync(System.Net.Mail.MailMessage,System.Object)
     
System.Collections.Specialized.NameValueCollection
#ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)
     
System.ComponentModel.ListChangedEventArgs
#ctor(System.ComponentModel.ListChangedType,System.Int32)
get_ListChangedType
get_NewIndex
#ctor(System.ComponentModel.ListChangedType,System.Int32,System.ComponentModel.PropertyDescriptor)
     
System.Xml.XmlWriterUse Dispose() instead.
CloseUse Dispose() instead.
     
System.Diagnostics.EventSourceCreationData
#ctor(System.String,System.String)
set_MachineName(System.String)
     
System.ExceptionRemove. Ctor overload taking SerializationInfo is not applicable in new surface area
#ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)Remove. Ctor overload taking SerializationInfo is not applicable in new surface area
GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)Remove. Getting rid of other usage of SerializationInfo will remove the need for this method.
GetTypeFalse positive (GetType() from Object is sufficient)
     
System.Security.Permissions.PermissionState
     
System.Enum
GetTypeCode
     
System.Reflection.ParameterInfo
IsDefined(System.Type,System.Boolean)
GetOptionalCustomModifiers
GetRequiredCustomModifiers
     
System.Reflection.FieldInfo
get_IsNotSerialized
     
System.Reflection.Assembly
GetCustomAttributes(System.Type,System.Boolean)
Load(System.String)use Assembly.Load(new AssemblyName(string))
GetExecutingAssemblytypeof(CurrentType).GetTypeInfo().Assembly
     
System.Threading.ThreadUse System.Globalization.CultureInfo.CurrentCulture
get_CurrentCultureUse System.Globalization.CultureInfo.CurrentCulture
GetDomain
     
System.Configuration.ConfigurationManagerUse configuration appropriate for your application model. For portable Framework Components, expose API for configuration on type
GetSection(System.String)Remove usage: track configuration via alternate means.
     
System.ComponentModel.ListChangedEventHandler
Invoke(System.Object,System.ComponentModel.ListChangedEventArgs)
#ctor(System.Object,System.IntPtr)
     
System.Converter`2Remove usage. Implement conversion code yourself if needed.
     
System.Reflection.Emit.AssemblyBuilder
DefineDynamicModule(System.String,System.Boolean)
Save(System.String)
DefineDynamicModule(System.String,System.String,System.Boolean)
     
System.Xml.Xsl.IXsltContextFunction
     
System.Runtime.Remoting.Proxies.RealProxyRemove usage
     
System.Xml.XmlNode
CreateNavigator
     
System.Runtime.Serialization.FormatterServices
GetSerializableMembers(System.Type)
GetSafeUninitializedObject(System.Type)
PopulateObjectMembers(System.Object,System.Reflection.MemberInfo[],System.Object[])
     
System.Security.SecuritySafeCriticalAttribute
#ctor
     
System.Reflection.ICustomAttributeProvider
GetCustomAttributes(System.Boolean)
GetCustomAttributes(System.Type,System.Boolean)
     
System.Reflection.AssemblyName
set_KeyPair(System.Reflection.StrongNameKeyPair)
     
System.Security.Permissions.SecurityPermissionAttributeRemove usage
     
System.Reflection.Module
op_Inequality(System.Reflection.Module,System.Reflection.Module)
op_Equality(System.Reflection.Module,System.Reflection.Module)
     
System.Runtime.Serialization.SerializationInfoRemove serialization constructors on custom Exception types
GetString(System.String)Remove serialization constructors on custom Exception types
GetValue(System.String,System.Type)either 1) Delete Serialization info from exceptions (since this can't be remoted) or 2) Use a different serialization technology if not for exceptions.
SetType(System.Type)
AddValue(System.String,System.Object)Remove serialization constructors on custom Exception types
     
System.Reflection.MemberInfouse "is FieldInfo", "is PropertyInfo", etc
get_MemberTypeuse "is FieldInfo", "is PropertyInfo", etc
get_ReflectedTypeRemove usage: Use reference to object being reflected on to get this value instead.
     
System.Reflection.EventInfo
GetAddMethod(System.Boolean)
GetRemoveMethod(System.Boolean)
     
System.DelegateUse MethodInfo.CreateDelegate
CreateDelegate(System.Type,System.Object,System.Reflection.MethodInfo)Use MethodInfo.CreateDelegate
get_MethodUse System.Reflection.RuntimeReflectionExtensions.GetMethodInfo
CreateDelegate(System.Type,System.Type,System.String)Use MethodInfo.CreateDelegate
     
System.ComponentModel.AddingNewEventHandler
#ctor(System.Object,System.IntPtr)
     
System.Security.CodeAccessPermissionRemove usage
DemandRemove usage
     
System.Reflection.MethodBase
GetCurrentMethod
GetMethodImplementationFlags
     
System.Xml.XmlConvert
IsWhitespaceChar(System.Char)
IsNCNameChar(System.Char)
IsStartNCNameChar(System.Char)
     
System.Security.IPermission
     
System.MarshalByRefObjectRemove usage
#ctorRemove usage
     
System.Reflection.ParameterModifierUse an overload that does not take a ParameterModifier array.
     
System.ComponentModel.TypeDescriptor
GetProperties(System.Type)
     
System.ComponentModel.ICancelAddNew
     
System.Security.SecurityRuleSetRemove usage
     
System.ComponentModel.ListChangedType
     
System.ComponentModel.ListSortDirection
     
System.Runtime.Serialization.IObjectReference
     
System.Reflection.MemberTypesUse is operator. Example: if (membertype == membertypes.Field) --> if (member is FieldInfo)
     
System.Runtime.Serialization.ISerializable
     
System.Security.SecurityRulesAttributeThere is only one security transparency model on non-desktop SKUs, so there's nothing to do with this attribute. It should just be removed from non-desktop-fwk assemblies.
#ctor(System.Security.SecurityRuleSet)There is only one security transparency model on non-desktop SKUs, so there's nothing to do with this attribute. It should just be removed from non-desktop-fwk assemblies.
     
System.IO.TextWriterUse Dispose instead
CloseUse Dispose instead
     
System.Security.SecurityCriticalAttribute
#ctor
     
System.Reflection.TargetException
     
System.Xml.XmlReaderUse Dispose() instead.
CloseUse Dispose() instead.
     
System.Reflection.BinderUse an overload that does not take a Binder.
     
Back to summary

Moq

Target type.NET Framework 4.6ASP.NET 5 1.0Mono 4.5Recommended changes
System.Type.GetTypeInfo().IsNestedAssembly
get_IsNestedAssembly.GetTypeInfo().IsNestedAssembly
get_IsPrimitive.GetTypeInfo().IsPrimitive
get_IsVisible.GetTypeInfo().IsVisible
get_IsPublic.GetTypeInfo().IsPublic
get_IsSerializable.GetTypeInfo().IsSerializable
GetInterfaceMap(System.Type)
get_IsSealed.GetTypeInfo().IsSealed
get_IsInterface.GetTypeInfo().IsInterface
get_IsValueType.GetTypeInfo().IsValueType
get_IsClass.GetTypeInfo().IsClass
get_IsNestedPublic.GetTypeInfo().IsNestedPublic
get_GUID
get_IsNestedFamORAssem.GetTypeInfo().IsNestedFamORAssem
get_IsGenericTypeDefinition.GetTypeInfo().IsGenericTypeDefinition
get_BaseType.GetTypeInfo().BaseType
get_DeclaringMethod
GetGenericParameterConstraints.GetTypeInfo().GetGenericParameterConstraints()
get_IsImport.GetTypeInfo().IsImport
get_Assembly.GetTypeInfo().Assembly
get_UnderlyingSystemType
InvokeMember(System.String,System.Reflection.BindingFlags,System.Reflection.Binder,System.Object,System.Object[])Find member and use appropriate invocation method based off BindingFlags values used in original call (varies by type of member)
get_IsGenericType.GetTypeInfo().IsGenericType
IsSubclassOf(System.Type).GetTypeInfo().IsSubclassOf
GetConstructor(System.Reflection.BindingFlags,System.Reflection.Binder,System.Type[],System.Reflection.ParameterModifier[])Use GetConstructor(Type[]) to search for public constructors by parameter type or filter the results of GetConstructors(BindingFlags) using LINQ for other queries.
GetMethod(System.String,System.Reflection.BindingFlags,System.Reflection.Binder,System.Type[],System.Reflection.ParameterModifier[])Use GetMethod(string, Type[]) to search for public methods by name and parameter type or filter the results of GetMethods(BindingFlags) using LINQ for other queries.
get_ContainsGenericParameters.GetTypeInfo().ContainsGenericParameters
GetInterface(System.String,System.Boolean)Enumerate across TypeInfo.ImplementedInterfaces
get_IsEnum.GetTypeInfo().IsEnum
get_IsAbstract.GetTypeInfo().IsAbstract
get_GenericParameterAttributes
     
System.Reflection.PropertyInfoUse PropertyInfo.GetMethod property
GetGetMethodUse PropertyInfo.GetMethod property
GetSetMethodUse PropertyInfo.SetMethod property
GetGetMethod(System.Boolean)Use PropertyInfo.GetMethod property
GetSetMethod(System.Boolean)Use PropertyInfo.SetMethod property
     
System.AttributeUse System.Reflection.CustomAttributeExtensions.IsDefined() in System.Reflection.Extensions
IsDefined(System.Reflection.MemberInfo,System.Type)Use System.Reflection.CustomAttributeExtensions.IsDefined() in System.Reflection.Extensions
GetCustomAttribute(System.Reflection.MemberInfo,System.Type)
     
System.SerializableAttributeRemove this attribute
#ctorRemove this attribute
     
System.Reflection.Emit.TypeBuilder
CreateType
     
System.Security.Permissions.ReflectionPermissionAttribute
     
System.Security.Permissions.PermissionSetAttributeRemove usage
     
System.Diagnostics.StackTrace
GetFrames
#ctor(System.Boolean)
     
System.ExceptionRemove. Ctor overload taking SerializationInfo is not applicable in new surface area
#ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)Remove. Ctor overload taking SerializationInfo is not applicable in new surface area
GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)Remove. Getting rid of other usage of SerializationInfo will remove the need for this method.
GetTypeFalse positive (GetType() from Object is sufficient)
     
System.CodeDom.Compiler.CodeDomProvider
GetTypeOutput(System.CodeDom.CodeTypeReference)
     
System.Reflection.Assembly
GetCustomAttributes(System.Type,System.Boolean)
Load(System.String)use Assembly.Load(new AssemblyName(string))
GetExecutingAssemblytypeof(CurrentType).GetTypeInfo().Assembly
     
System.Reflection.ICustomAttributeProvider
GetCustomAttributes(System.Boolean)
GetCustomAttributes(System.Type,System.Boolean)
     
System.Security.Permissions.SecurityPermissionAttributeRemove usage
     
System.Runtime.Serialization.SerializationInfoRemove serialization constructors on custom Exception types
GetString(System.String)Remove serialization constructors on custom Exception types
GetValue(System.String,System.Type)either 1) Delete Serialization info from exceptions (since this can't be remoted) or 2) Use a different serialization technology if not for exceptions.
SetType(System.Type)
AddValue(System.String,System.Object)Remove serialization constructors on custom Exception types
     
System.CodeDom.CodeTypeReference
#ctor(System.Type)
     
System.Security.Permissions.UIPermissionAttribute
     
System.Reflection.MemberInfouse "is FieldInfo", "is PropertyInfo", etc
get_MemberTypeuse "is FieldInfo", "is PropertyInfo", etc
get_ReflectedTypeRemove usage: Use reference to object being reflected on to get this value instead.
     
System.DelegateUse MethodInfo.CreateDelegate
CreateDelegate(System.Type,System.Object,System.Reflection.MethodInfo)Use MethodInfo.CreateDelegate
get_MethodUse System.Reflection.RuntimeReflectionExtensions.GetMethodInfo
CreateDelegate(System.Type,System.Type,System.String)Use MethodInfo.CreateDelegate
     
Microsoft.CSharp.CSharpCodeProvider
#ctor
     
System.Diagnostics.StackFrame
GetFileLineNumber
GetMethod
GetFileName
     
System.Reflection.MethodBase
GetCurrentMethod
GetMethodImplementationFlags
     
System.Reflection.ParameterModifierUse an overload that does not take a ParameterModifier array.
     
System.Reflection.MemberTypesUse is operator. Example: if (membertype == membertypes.Field) --> if (member is FieldInfo)
     
System.Security.SecurityCriticalAttribute
#ctor
     
System.Reflection.BinderUse an overload that does not take a Binder.
     
Back to summary