# .NET Portability Report

## Summary

Assembly | .NET Framework 4.6 | ASP.NET 5 1.0
--- | --- | ---
Orleans | 100% | 91.55%

### Orleans

Target type | .NET Framework 4.6 | ASP.NET 5 1.0 | Recommended changes
--- | --- | --- | ---
System.Management.ManagementObjectSearcher |  |  |
#ctor(System.String) |  |  |
Get |  |  |
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter |  |  |
Serialize(System.IO.Stream,System.Object) |  |  |
set_Binder(System.Runtime.Serialization.SerializationBinder) |  |  |
Deserialize(System.IO.Stream) |  |  |
#ctor |  |  |
System.Type |  |  | .GetTypeInfo().IsNestedFamily
get_IsNestedFamily |  |  | .GetTypeInfo().IsNestedFamily
get_IsNotPublic |  |  | .GetTypeInfo().IsNotPublic
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.
GetGenericParameterConstraints |  |  | .GetTypeInfo().GetGenericParameterConstraints()
ReflectionOnlyGetType(System.String,System.Boolean,System.Boolean) |  |  |
get_IsInterface |  |  | .GetTypeInfo().IsInterface
get_IsEnum |  |  | .GetTypeInfo().IsEnum
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.
GetInterfaceMap(System.Type) |  |  |
get_IsNestedPrivate |  |  | .GetTypeInfo().IsNestedPrivate
get_GenericParameterAttributes |  |  |
get_BaseType |  |  | .GetTypeInfo().BaseType
get_IsSerializable |  |  | .GetTypeInfo().IsSerializable
get_IsNestedPublic |  |  | .GetTypeInfo().IsNestedPublic
get_IsGenericTypeDefinition |  |  | .GetTypeInfo().IsGenericTypeDefinition
get_IsGenericType |  |  | .GetTypeInfo().IsGenericType
get_IsValueType |  |  | .GetTypeInfo().IsValueType
get_IsClass |  |  | .GetTypeInfo().IsClass
get_IsAbstract |  |  | .GetTypeInfo().IsAbstract
get_IsPrimitive |  |  | .GetTypeInfo().IsPrimitive
get_Assembly |  |  | .GetTypeInfo().Assembly
GetTypeCode(System.Type) |  |  | Use Type or RuntimeTypeHandle instead.
get_UnderlyingSystemType |  |  |
get_Module |  |  | Use System.Reflection.AssemblyExtensions.GetModules(), iterate over returned collection.
System.CodeDom.CodeTypeParameterCollection |  |  |
Add(System.CodeDom.CodeTypeParameter) |  |  |
#ctor |  |  |
System.MarshalByRefObject |  |  | Remove usage: Remoting is no longer available
#ctor |  |  | Remove usage
System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute |  |  |
#ctor |  |  |
System.Runtime.Serialization.SerializationInfo |  |  | 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.
GetString(System.String) |  |  | Remove serialization constructors on custom Exception types
GetBoolean(System.String) |  |  | either 1) Delete Serialization info from exceptions (since this can't be remoted) or 2) Use a different serialization technology if not for exceptions.
AddValue(System.String,System.Object) |  |  | Remove serialization constructors on custom Exception types
AddValue(System.String,System.Object,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.
System.IO.TextWriter |  |  | Use Dispose instead
Close |  |  | Use Dispose instead
System.Management.ManagementObjectCollection.ManagementObjectEnumerator |  |  |
MoveNext |  |  |
get_Current |  |  |
System.Reflection.CustomAttributeData |  |  |
GetCustomAttributes(System.Reflection.MemberInfo) |  |  |
System.Reflection.Assembly |  |  |
ReflectionOnlyLoadFrom(System.String) |  |  |
ReflectionOnlyLoad(System.String) |  |  |
GetCustomAttributes(System.Boolean) |  |  |
GetTypes |  |  | Use Assembly.DefinedTypes
get_Location |  |  | Remove usage
GetCallingAssembly |  |  |
LoadFrom(System.String) |  |  | Use AssemblyLoadContext
CreateInstance(System.String) |  |  | Use System.Activator.CreateInstance(Assembly.GetType()) on type you are interested in.
GetExecutingAssembly |  |  | typeof(CurrentType).GetTypeInfo().Assembly
GetType(System.String,System.Boolean) |  |  | Use Assembly.GetType(string), throw if you receive null return value.
get_ReflectionOnly |  |  |
GetEntryAssembly |  |  |
Load(System.String) |  |  | use Assembly.Load(new AssemblyName(string))
System.Management.ManagementObjectCollection |  |  |
GetEnumerator |  |  |
System.Xml.XmlTextWriter |  |  |
#ctor(System.IO.TextWriter) |  |  |
System.Exception |  |  | Remove. Getting rid of other usage of SerializationInfo will remove the need for this method.
GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext) |  |  | Remove. Getting rid of other usage of SerializationInfo will remove the need for this method.
GetType |  |  | False positive (GetType() from Object is sufficient)
System.Threading.Thread |  |  | This is only reliable in SQL Server. Elsewhere, don't use it.
ResetAbort |  |  | This is only reliable in SQL Server. Elsewhere, don't use it.
Abort(System.Object) |  |  | This is only reliable in SQL Server. Elsewhere, don't use it.
System.CodeDom.CodeTypeParameter |  |  |
get_Constraints |  |  |
set_HasConstructorConstraint(System.Boolean) |  |  |
#ctor(System.String) |  |  |
System.Environment |  |  | Do not use. Choose action based feature availability, not OS / Platform
get_Version |  |  | Do not use. Choose action based feature availability, not OS / Platform
GetFolderPath(System.Environment.SpecialFolder,System.Environment.SpecialFolderOption) |  |  |
get_OSVersion |  |  | Do not use. Choose action based feature availability, not OS / Platform
get_UserName |  |  |
System.Net.Dns |  |  |
GetHostAddresses(System.String) |  |  |
System.NonSerializedAttribute |  |  | Remove usage
#ctor |  |  | Remove usage
System.AppDomain |  |  |
remove_ReflectionOnlyAssemblyResolve(System.ResolveEventHandler) |  |  |
ApplyPolicy(System.String) |  |  |
GetAssemblies |  |  | Remove usage
add_DomainUnload(System.EventHandler) |  |  | Use object with finalizer stored in static variable, or use app-model specific unload notifications (e.g. Application.Suspending event for modern apps)
add_AssemblyLoad(System.AssemblyLoadEventHandler) |  |  |
add_AssemblyResolve(System.ResolveEventHandler) |  |  | Remove usage
get_CurrentDomain |  |  | Remove usage
ReflectionOnlyGetAssemblies |  |  |
add_ReflectionOnlyAssemblyResolve(System.ResolveEventHandler) |  |  |
System.Diagnostics.PerformanceCounter |  |  |
get_RawValue |  |  |
get_CounterName |  |  |
#ctor(System.String,System.String,System.Boolean) |  |  |
#ctor(System.String,System.String,System.String,System.Boolean) |  |  |
NextValue |  |  |
System.Security.Cryptography.SHA256CryptoServiceProvider |  |  |
#ctor |  |  |
System.SerializableAttribute |  |  | Remove this attribute
#ctor |  |  | Remove this attribute
System.Management.ManagementBaseObject |  |  |
get_Properties |  |  |
System.ResolveEventHandler |  |  | Use AssemblyLoadContext
#ctor(System.Object,System.IntPtr) |  |  | Use AssemblyLoadContext
System.Diagnostics.PerformanceCounterCategory |  |  |
GetInstanceNames |  |  |
#ctor(System.String) |  |  |
GetCounters(System.String) |  |  |
System.Environment.SpecialFolder |  |  |
System.IO.TextReader |  |  | Use Dispose instead
Close |  |  | Use Dispose instead
System.ResolveEventArgs |  |  |
get_RequestingAssembly |  |  |
get_Name |  |  | Use AssemblyLoadContext
System.Runtime.Serialization.SerializationBinder |  |  |
#ctor |  |  |
System.Environment.SpecialFolderOption |  |  |
System.UriTypeConverter |  |  |
#ctor |  |  |
System.OperatingSystem |  |  | Do not use. Couple behavior to feature availability, not OS version or Platform.
System.ApplicationException |  |  | Use other exception types.
#ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext) |  |  | Use other exception types.
#ctor(System.String) |  |  | Use other exception types.
#ctor(System.String,System.Exception) |  |  | Use other exception types.
System.Threading.ThreadPool |  |  | Change code to not depend on the size of the ThreadPool for functionality. Portable code needs to be able to run correctly on multiple different ThreadPool implementations, not all of which support this method.
GetMinThreads(System.Int32@,System.Int32@) |  |  | Change code to not depend on the size of the ThreadPool for functionality. Portable code needs to be able to run correctly on multiple different ThreadPool implementations, not all of which support this method.
GetMaxThreads(System.Int32@,System.Int32@) |  |  | Change code to not depend on the size of the ThreadPool for functionality. Portable code needs to be able to run correctly on multiple different ThreadPool implementations, not all of which support this method.
GetAvailableThreads(System.Int32@,System.Int32@) |  |  |
System.Management.PropertyDataCollection |  |  |
get_Item(System.String) |  |  |
System.CodeDom.CodeTypeReference |  |  |
#ctor(System.String) |  |  |
System.Console |  |  |
set_Title(System.String) |  |  |
System.Diagnostics.CorrelationManager |  |  |
set_ActivityId(System.Guid) |  |  |
get_ActivityId |  |  |
System.Delegate |  |  | Use MethodInfo.CreateDelegate
CreateDelegate(System.Type,System.Reflection.MethodInfo) |  |  | Use MethodInfo.CreateDelegate
get_Method |  |  | Use System.Reflection.RuntimeReflectionExtensions.GetMethodInfo
System.Xml.XmlNode |  |  |
SelectNodes(System.String,System.Xml.XmlNamespaceManager) |  |  |
System.Runtime.Remoting.Messaging.CallContext |  |  |
LogicalSetData(System.String,System.Object) |  |  |
FreeNamedDataSlot(System.String) |  |  |
LogicalGetData(System.String) |  |  |
System.CodeDom.CodeTypeReferenceCollection |  |  |
Add(System.String) |  |  |
Add(System.CodeDom.CodeTypeReference) |  |  |
System.Runtime.Serialization.ISerializable |  |  |
System.Reflection.ParameterModifier |  |  | Use an overload that does not take a ParameterModifier array.
System.Diagnostics.StackTrace |  |  |
#ctor(System.Boolean) |  |  |
System.IO.StreamReader |  |  | Use File.OpenText, or use File.Open to get a Stream then pass it to StreamReader constructor
#ctor(System.String) |  |  | Use File.OpenText, or use File.Open to get a Stream then pass it to StreamReader constructor
System.String |  |  | Use CultureInfo.TextInfo.ToLower(String) instead
ToLower(System.Globalization.CultureInfo) |  |  | Use CultureInfo.TextInfo.ToLower(String) instead
System.AssemblyLoadEventArgs |  |  |
get_LoadedAssembly |  |  |
System.Activator |  |  |
CreateInstance(System.Type,System.Boolean) |  |  |
System.Diagnostics.Trace |  |  |
get_CorrelationManager |  |  |
System.AssemblyLoadEventHandler |  |  |
#ctor(System.Object,System.IntPtr) |  |  |
System.Diagnostics.Process |  |  | Use System.Diagnostics.Process.SafeHandle
get_Handle |  |  | Use System.Diagnostics.Process.SafeHandle
System.Reflection.AssemblyName |  |  |
GetAssemblyName(System.String) |  |  |
System.Reflection.Binder |  |  | Use an overload that does not take a Binder.
System.Management.PropertyData |  |  |
get_Value |  |  |
System.Diagnostics.ConsoleTraceListener |  |  | useErrorStream ? new TextWriterTraceListener(Console.Error) : new TextWriterTraceListener(Console.Out)
System.Runtime.Serialization.FormatterServices |  |  |
GetUninitializedObject(System.Type) |  |  |
System.Net.Sockets.Socket |  |  | Use Dispose instead
Close |  |  | Use Dispose instead
System.Diagnostics.DebuggableAttribute |  |  |
get_IsJITTrackingEnabled |  |  |
System.Threading.ThreadAbortException |  |  | Do not use: exception cannot be caught since it is not thrown by framework, never throw this type. Thread.Abort is only reliable in SQL Server. Elsewhere, don't use it.
System.Management.ManagementObject |  |  |

Back to summary