在mac上安装最新的.NET Core 1.0,运行dotnet new命令出现如下的错误:
Unhandled Exception: System.TypeInitializationException: The type initializer for 'Crypto' threw an exception. ---> System.TypeInitializationException: The type initializer for 'CryptoInitializer' threw an exception. ---> System.DllNotFoundException: Unable to load DLL 'System.Security.Cryptography.Native': The specified module could not be found. (Exception from HRESULT: 0x8007007E) at Interop.CryptoInitializer.EnsureOpenSslInitialized() at Interop.CryptoInitializer..cctor() --- End of inner exception stack trace --- at Interop.Crypto..cctor() --- End of inner exception stack trace --- at Interop.Crypto.GetRandomBytes(Byte* buf, Int32 num) at System.IO.Path.GetCryptoRandomBytes(Byte* bytes, Int32 byteCount) at System.IO.Path.GetRandomFileName() at Microsoft.DotNet.InternalAbstractions.TemporaryDirectory..ctor() at Microsoft.Extensions.EnvironmentAbstractions.DirectoryWrapper.CreateTemporaryDirectory() at Microsoft.DotNet.Configurer.NuGetPackagesArchiver..ctor() at Microsoft.DotNet.Cli.Program.ConfigureDotNetForFirstTimeUse(INuGetCacheSentinel nugetCacheSentinel) at Microsoft.DotNet.Cli.Program.ProcessArgs(String[] args, ITelemetry telemetryClient) at Microsoft.DotNet.Cli.Program.Main(String[] args)
运行 brew link --force openssl 命令后解决
up