runtime: CoreFx implementation assemblies contain duplicate definitions of public types

The public types listed below have multiple definitions in CoreFX assemblies. This causes issues when the assemblies are used in dynamic/runtime compilation scenarios such as C# scripting (see e.g. https://github.com/dotnet/cli/issues/320), dynamic languages, dynamic runtime binders, etc. and in VS Expression Evaluators. All these tools work with implementation assemblies since the reference assemblies are not available.

These duplicate definitions should be made internal.

Duplicate types in recent .NET Core build:

Microsoft.Win32.SafeHandles.SafeRegistryHandle: "Microsoft.Win32.Registry, Version=4.0.0.0, PKT=b03f5f7f11d50a3a"; "mscorlib, Version=4.0.0.0, PKT=7cec85d7bea7798e"
Microsoft.Win32.SafeHandles.SafeFileHandle: "mscorlib, Version=4.0.0.0, PKT=7cec85d7bea7798e"; "System.IO.FileSystem, Version=4.0.1.0, PKT=b03f5f7f11d50a3a"
System.BitConverter: "mscorlib, Version=4.0.0.0, PKT=7cec85d7bea7798e"; "System.Runtime.Extensions, Version=4.0.11.0, PKT=b03f5f7f11d50a3a"
System.Console: "mscorlib, Version=4.0.0.0, PKT=7cec85d7bea7798e"; "System.Console, Version=4.0.0.0, PKT=b03f5f7f11d50a3a"
System.IO.Directory: "mscorlib, Version=4.0.0.0, PKT=7cec85d7bea7798e"; "System.IO.FileSystem, Version=4.0.1.0, PKT=b03f5f7f11d50a3a"
System.IO.DirectoryInfo: "mscorlib, Version=4.0.0.0, PKT=7cec85d7bea7798e"; "System.IO.FileSystem, Version=4.0.1.0, PKT=b03f5f7f11d50a3a"
System.IO.SearchOption: "mscorlib, Version=4.0.0.0, PKT=7cec85d7bea7798e"; "System.IO.FileSystem, Version=4.0.1.0, PKT=b03f5f7f11d50a3a"
System.IO.File: "mscorlib, Version=4.0.0.0, PKT=7cec85d7bea7798e"; "System.IO.FileSystem, Version=4.0.1.0, PKT=b03f5f7f11d50a3a"
System.IO.FileAccess: "mscorlib, Version=4.0.0.0, PKT=7cec85d7bea7798e"; "System.IO.FileSystem.Primitives, Version=4.0.1.0, PKT=b03f5f7f11d50a3a"
System.IO.FileInfo: "mscorlib, Version=4.0.0.0, PKT=7cec85d7bea7798e"; "System.IO.FileSystem, Version=4.0.1.0, PKT=b03f5f7f11d50a3a"
System.IO.FileMode: "mscorlib, Version=4.0.0.0, PKT=7cec85d7bea7798e"; "System.IO.FileSystem.Primitives, Version=4.0.1.0, PKT=b03f5f7f11d50a3a"
System.IO.FileShare: "mscorlib, Version=4.0.0.0, PKT=7cec85d7bea7798e"; "System.IO.FileSystem.Primitives, Version=4.0.1.0, PKT=b03f5f7f11d50a3a"
System.IO.FileStream: "mscorlib, Version=4.0.0.0, PKT=7cec85d7bea7798e"; "System.IO.FileSystem, Version=4.0.1.0, PKT=b03f5f7f11d50a3a"
System.IO.FileSystemInfo: "mscorlib, Version=4.0.0.0, PKT=7cec85d7bea7798e"; "System.IO.FileSystem, Version=4.0.1.0, PKT=b03f5f7f11d50a3a"
System.IO.FileAttributes: "mscorlib, Version=4.0.0.0, PKT=7cec85d7bea7798e"; "System.IO.FileSystem.Primitives, Version=4.0.1.0, PKT=b03f5f7f11d50a3a"
System.IO.Path: "mscorlib, Version=4.0.0.0, PKT=7cec85d7bea7798e"; "System.Runtime.Extensions, Version=4.0.11.0, PKT=b03f5f7f11d50a3a"
System.Collections.CollectionBase: "mscorlib, Version=4.0.0.0, PKT=7cec85d7bea7798e"; "System.Collections.NonGeneric, Version=4.0.1.0, PKT=b03f5f7f11d50a3a"
System.Collections.StructuralComparisons: "mscorlib, Version=4.0.0.0, PKT=7cec85d7bea7798e"; "System.Collections, Version=4.0.11.0, PKT=b03f5f7f11d50a3a"
System.Collections.ObjectModel.ReadOnlyDictionary`2: "mscorlib, Version=4.0.0.0, PKT=7cec85d7bea7798e"; "System.ObjectModel, Version=4.0.11.0, PKT=b03f5f7f11d50a3a"
System.Collections.ObjectModel.KeyedCollection`2: "mscorlib, Version=4.0.0.0, PKT=7cec85d7bea7798e"; "System.ObjectModel, Version=4.0.11.0, PKT=b03f5f7f11d50a3a"
System.Security.Cryptography.CipherMode: "mscorlib, Version=4.0.0.0, PKT=7cec85d7bea7798e"; "System.Security.Cryptography.Primitives, Version=4.0.0.0, PKT=b03f5f7f11d50a3a"
System.Security.Cryptography.PaddingMode: "mscorlib, Version=4.0.0.0, PKT=7cec85d7bea7798e"; "System.Security.Cryptography.Primitives, Version=4.0.0.0, PKT=b03f5f7f11d50a3a"
System.Security.Cryptography.KeySizes: "mscorlib, Version=4.0.0.0, PKT=7cec85d7bea7798e"; "System.Security.Cryptography.Primitives, Version=4.0.0.0, PKT=b03f5f7f11d50a3a"
System.Security.Cryptography.CryptographicException: "mscorlib, Version=4.0.0.0, PKT=7cec85d7bea7798e"; "System.Security.Cryptography.Primitives, Version=4.0.0.0, PKT=b03f5f7f11d50a3a"
System.Security.Cryptography.ICryptoTransform: "mscorlib, Version=4.0.0.0, PKT=7cec85d7bea7798e"; "System.Security.Cryptography.Primitives, Version=4.0.0.0, PKT=b03f5f7f11d50a3a"
System.Security.Cryptography.RandomNumberGenerator: "mscorlib, Version=4.0.0.0, PKT=7cec85d7bea7798e"; "System.Security.Cryptography.Algorithms, Version=4.0.0.0, PKT=b03f5f7f11d50a3a"
System.Security.Cryptography.Aes: "mscorlib, Version=4.0.0.0, PKT=7cec85d7bea7798e"; "System.Security.Cryptography.Algorithms, Version=4.0.0.0, PKT=b03f5f7f11d50a3a"
System.Security.Cryptography.AsymmetricAlgorithm: "mscorlib, Version=4.0.0.0, PKT=7cec85d7bea7798e"; "System.Security.Cryptography.Primitives, Version=4.0.0.0, PKT=b03f5f7f11d50a3a"
System.Security.Cryptography.CspProviderFlags: "mscorlib, Version=4.0.0.0, PKT=7cec85d7bea7798e"; "System.Security.Cryptography.Csp, Version=4.0.0.0, PKT=b03f5f7f11d50a3a"
System.Security.Cryptography.CspParameters: "mscorlib, Version=4.0.0.0, PKT=7cec85d7bea7798e"; "System.Security.Cryptography.Csp, Version=4.0.0.0, PKT=b03f5f7f11d50a3a"
System.Security.Cryptography.CryptoStreamMode: "mscorlib, Version=4.0.0.0, PKT=7cec85d7bea7798e"; "System.Security.Cryptography.Primitives, Version=4.0.0.0, PKT=b03f5f7f11d50a3a"
System.Security.Cryptography.CryptoStream: "mscorlib, Version=4.0.0.0, PKT=7cec85d7bea7798e"; "System.Security.Cryptography.Primitives, Version=4.0.0.0, PKT=b03f5f7f11d50a3a"
System.Security.Cryptography.DeriveBytes: "mscorlib, Version=4.0.0.0, PKT=7cec85d7bea7798e"; "System.Security.Cryptography.Algorithms, Version=4.0.0.0, PKT=b03f5f7f11d50a3a"
System.Security.Cryptography.HMAC: "mscorlib, Version=4.0.0.0, PKT=7cec85d7bea7798e"; "System.Security.Cryptography.Primitives, Version=4.0.0.0, PKT=b03f5f7f11d50a3a"
System.Security.Cryptography.HMACSHA1: "mscorlib, Version=4.0.0.0, PKT=7cec85d7bea7798e"; "System.Security.Cryptography.Algorithms, Version=4.0.0.0, PKT=b03f5f7f11d50a3a"
System.Security.Cryptography.HMACSHA256: "mscorlib, Version=4.0.0.0, PKT=7cec85d7bea7798e"; "System.Security.Cryptography.Algorithms, Version=4.0.0.0, PKT=b03f5f7f11d50a3a"
System.Security.Cryptography.HMACSHA384: "mscorlib, Version=4.0.0.0, PKT=7cec85d7bea7798e"; "System.Security.Cryptography.Algorithms, Version=4.0.0.0, PKT=b03f5f7f11d50a3a"
System.Security.Cryptography.HMACSHA512: "mscorlib, Version=4.0.0.0, PKT=7cec85d7bea7798e"; "System.Security.Cryptography.Algorithms, Version=4.0.0.0, PKT=b03f5f7f11d50a3a"
System.Security.Cryptography.HashAlgorithm: "mscorlib, Version=4.0.0.0, PKT=7cec85d7bea7798e"; "System.Security.Cryptography.Primitives, Version=4.0.0.0, PKT=b03f5f7f11d50a3a"
System.Security.Cryptography.KeyNumber: "mscorlib, Version=4.0.0.0, PKT=7cec85d7bea7798e"; "System.Security.Cryptography.Csp, Version=4.0.0.0, PKT=b03f5f7f11d50a3a"
System.Security.Cryptography.CspKeyContainerInfo: "mscorlib, Version=4.0.0.0, PKT=7cec85d7bea7798e"; "System.Security.Cryptography.Csp, Version=4.0.0.0, PKT=b03f5f7f11d50a3a"
System.Security.Cryptography.ICspAsymmetricAlgorithm: "mscorlib, Version=4.0.0.0, PKT=7cec85d7bea7798e"; "System.Security.Cryptography.Csp, Version=4.0.0.0, PKT=b03f5f7f11d50a3a"
System.Security.Cryptography.KeyedHashAlgorithm: "mscorlib, Version=4.0.0.0, PKT=7cec85d7bea7798e"; "System.Security.Cryptography.Primitives, Version=4.0.0.0, PKT=b03f5f7f11d50a3a"
System.Security.Cryptography.MD5: "mscorlib, Version=4.0.0.0, PKT=7cec85d7bea7798e"; "System.Security.Cryptography.Algorithms, Version=4.0.0.0, PKT=b03f5f7f11d50a3a"
System.Security.Cryptography.Rfc2898DeriveBytes: "mscorlib, Version=4.0.0.0, PKT=7cec85d7bea7798e"; "System.Security.Cryptography.Algorithms, Version=4.0.0.0, PKT=b03f5f7f11d50a3a"
System.Security.Cryptography.RSAParameters: "mscorlib, Version=4.0.0.0, PKT=7cec85d7bea7798e"; "System.Security.Cryptography.Algorithms, Version=4.0.0.0, PKT=b03f5f7f11d50a3a"
System.Security.Cryptography.RSA: "mscorlib, Version=4.0.0.0, PKT=7cec85d7bea7798e"; "System.Security.Cryptography.Algorithms, Version=4.0.0.0, PKT=b03f5f7f11d50a3a"
System.Security.Cryptography.RSACryptoServiceProvider: "mscorlib, Version=4.0.0.0, PKT=7cec85d7bea7798e"; "System.Security.Cryptography.Csp, Version=4.0.0.0, PKT=b03f5f7f11d50a3a"
System.Security.Cryptography.SHA1: "mscorlib, Version=4.0.0.0, PKT=7cec85d7bea7798e"; "System.Security.Cryptography.Algorithms, Version=4.0.0.0, PKT=b03f5f7f11d50a3a"
System.Security.Cryptography.SHA256: "mscorlib, Version=4.0.0.0, PKT=7cec85d7bea7798e"; "System.Security.Cryptography.Algorithms, Version=4.0.0.0, PKT=b03f5f7f11d50a3a"
System.Security.Cryptography.SHA384: "mscorlib, Version=4.0.0.0, PKT=7cec85d7bea7798e"; "System.Security.Cryptography.Algorithms, Version=4.0.0.0, PKT=b03f5f7f11d50a3a"
System.Security.Cryptography.SHA512: "mscorlib, Version=4.0.0.0, PKT=7cec85d7bea7798e"; "System.Security.Cryptography.Algorithms, Version=4.0.0.0, PKT=b03f5f7f11d50a3a"
System.Security.Cryptography.SymmetricAlgorithm: "mscorlib, Version=4.0.0.0, PKT=7cec85d7bea7798e"; "System.Security.Cryptography.Primitives, Version=4.0.0.0, PKT=b03f5f7f11d50a3a"
System.Security.Cryptography.X509Certificates.X509ContentType: "mscorlib, Version=4.0.0.0, PKT=7cec85d7bea7798e"; "System.Security.Cryptography.X509Certificates, Version=4.0.0.0, PKT=b03f5f7f11d50a3a"
System.Security.Cryptography.X509Certificates.X509KeyStorageFlags: "mscorlib, Version=4.0.0.0, PKT=7cec85d7bea7798e"; "System.Security.Cryptography.X509Certificates, Version=4.0.0.0, PKT=b03f5f7f11d50a3a"
System.Security.Cryptography.X509Certificates.X509Certificate: "mscorlib, Version=4.0.0.0, PKT=7cec85d7bea7798e"; "System.Security.Cryptography.X509Certificates, Version=4.0.0.0, PKT=b03f5f7f11d50a3a"
System.Security.Principal.IIdentity: "mscorlib, Version=4.0.0.0, PKT=7cec85d7bea7798e"; "System.Security.Principal, Version=4.0.1.0, PKT=b03f5f7f11d50a3a"
System.Security.Principal.IPrincipal: "mscorlib, Version=4.0.0.0, PKT=7cec85d7bea7798e"; "System.Security.Principal, Version=4.0.1.0, PKT=b03f5f7f11d50a3a"
System.Security.Principal.TokenImpersonationLevel: "mscorlib, Version=4.0.0.0, PKT=7cec85d7bea7798e"; "System.Security.Principal, Version=4.0.1.0, PKT=b03f5f7f11d50a3a"
System.Threading.WaitHandleExtensions: "mscorlib, Version=4.0.0.0, PKT=7cec85d7bea7798e"; "System.Runtime.Handles, Version=4.0.1.0, PKT=b03f5f7f11d50a3a"
System.Threading.CountdownEvent: "mscorlib, Version=4.0.0.0, PKT=7cec85d7bea7798e"; "System.Threading, Version=4.0.11.0, PKT=b03f5f7f11d50a3a"

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 2
  • Comments: 19 (17 by maintainers)

Commits related to this issue

Most upvoted comments

I see, well, good enough too. Hopefully that reflection hack will still work, but anyway we can stop using the hack altogether and just reference a newer version of the standard once that happens. A ping in this thread with a heads up would be valuable if possible when something changes regarding this.

We ran into this issue with our runtime code generation in dotnet/orleans while porting to .NET Core/Standard. Currently I’m trying the reflection-based hack implemented by @vors for PowerShell.