question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

dotnet restore failing with "Unable to load DLL 'System.Security.Cryptography.Native'" on macosx

See original GitHub issue

Steps to reproduce

/temp/hwapp$ dotnet new /temp/hwapp$ dotnet restore log : Restoring packages for /Users/xxx/temp/hwapp/project.json… error: The type initializer for ‘Crypto’ threw an exception. error: Unable to load DLL ‘System.Security.Cryptography.Native’: The specified module could not be found. error: (Exception from HRESULT: 0x8007007E)

Expected behavior

I expected to get no error while restoring packages.

Actual behavior

Getting the error below while restoring packages: error: The type initializer for ‘Crypto’ threw an exception. error: Unable to load DLL ‘System.Security.Cryptography.Native’: The specified module could not be found. error: (Exception from HRESULT: 0x8007007E)

Environment data

dotnet --info output:

/temp/hwapp$ dotnet --info
Unknown option: --info
.NET Command Line Tools (1.0.0-beta-001598)
Usage: dotnet [common-options] [command] [arguments]

Arguments:
  [command]     The command to execute
  [arguments]   Arguments to pass to the command

Common Options (passed before the command):
  -v|--verbose  Enable verbose output
  --version     Display .NET CLI Version Info

Common Commands:
  new           Initialize a basic .NET project
  restore       Restore dependencies specified in the .NET project
  build         Builds a .NET project
  publish       Publishes a .NET project for deployment (including the runtime)
  run           Compiles and immediately executes a .NET project
  repl          Launch an interactive session (read, eval, print, loop)
  pack          Creates a NuGet package

Operating system: Darwin mak 15.4.0 Darwin Kernel Version 15.4.0: Fri Feb 26 22:08:05 PST 2016; root:xnu-3248.40.184~3/RELEASE_X86_64 x86_64

Installed OpenSSL with macports:

>sudo port installed | grep openssl
  openssl @1.0.1j_0+universal
  openssl @1.0.1k_0+universal
  openssl @1.0.2_0+universal
  openssl @1.0.2a_0+universal
  openssl @1.0.2d_0+universal
  openssl @1.0.2e_0+universal
  openssl @1.0.2f_0+universal
  openssl @1.0.2g_0+universal
  openssl @1.0.2g_0 (active)

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:22 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
sleemercommented, Jul 30, 2016

@nicc777 it doesn’t work for me… When i run this command i get brew link --force openssl Warning: Refusing to link: openssl Linking keg-only OpenSSL means you may end up linking against the insecure, deprecated system version while using the headers from the Homebrew version. Instead, pass the full include/library paths to your compiler e.g.: -I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib

2reactions
bartonjscommented, Jul 30, 2016

The recent change to homebrew is something that we’re trying to follow up on.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to load DLL 'System.Security.Cryptography.Native' ...
We're using .Net Core RC2 to build a desktop app with Web UI. It works fine on developer mac, but does not start...
Read more >
asp.net core and System.Security.Cryptography.Native.Apple
I try to save data into database using method SaveChanges() (DbContext class) and get next error: "System.DllNotFoundException: Unable to load ...
Read more >
DotNet Core “Unable to load DLL 'System.Security ...
I was trying to play with DotNet Core in Visual Studio Code, and I was following the instructions as stated here.
Read more >
Nuget restore - system cannot find file - Microsoft.Build. ...
Everytime I try to run Nuget restore I get this error. I get on another server that I am trying to put a...
Read more >
dotnet restore command - .NET CLI
Learn how to restore dependencies and project-specific tools with the dotnet restore command.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found