Sdk: dotnet restore fail on newly created project on Mac

Created on 8 May 2016  路  14Comments  路  Source: dotnet/sdk

Steps to reproduce

mkdir dotnettest
cd dotnettest
dotnet new
dotnet restore

Expected behavior

restore successfully

Actual behavior

log : Restoring packages for /Users/apple/Desktop/dotnettest1/project.json...
error: Unable to load the service index for source https://dotnet.myget.org/F/dotnet-core/api/v3/index.json.
error: The type initializer for 'Crypto' threw an exception.
error: The type initializer for 'CryptoInitializer' 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:

.NET Command Line Tools (1.0.0-preview1-preview1-002697)

Product Information:
Version: 1.0.0-preview1-preview1-002697
Commit Sha: 08b3ad9e88

Runtime Environment:
OS Name: Mac OS X
OS Version: 10.11
OS Platform: Darwin
RID: osx.10.11-x64

Most helpful comment

All 14 comments

@XiaoFaye I hate to jump in on a Mac issue (I'm way, way more Windows-ish these days), but given that it's Saturday night here ...

Use a different NuGet.config set of feeds for the app. Put a NuGet.config file (if it doesn't exist) that contains ..

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <clear />
    <add key="AspNetCI" value="https://www.myget.org/F/aspnetcirelease/api/v3/index.json" />
    <add key="NuGet.org" value="https://api.nuget.org/v3/index.json" />
  </packageSources>
</configuration>

... into the app and see if you can restore on that. This CI Release feed should give you good packages.

unfortunately same error message.

BTW: It seems with the latest version of CLI, the nuget.config file will be automatically created under windows, but not Mac???

Perhaps. idk on the Mac-side. Yes, they temporarily were creating it for Win. When RC2 hits, these packages will all be on NuGet.org, so the NuGet.config can go away for the dotnet new project. For now, yes.

I'll run dotnet new here and see what I get.

Yeah ... that went about as well as expected ...

error: Unable to resolve 'Microsoft.NETCore.App (>= 1.0.0-rc2-3002697)' for 
'.NETCoreApp,Version=v1.0'.

Try a CLI sample project. https://github.com/aspnet/cli-samples

In the meantime, I'll add the NuGet.config, which actually didn't show up this time, and see what's what with dotnet new.

It will restore if you * the version of Microsoft.NETCore.App and use the NuGet.config that I posted.

"dependencies": {
    "Microsoft.NETCore.App": {
      "type": "platform",
      "version": "1.0.0-*"
    }
  },

It's still not working, am I doing anything wrong? Do I need to remove previous installed RC1 dnx?

mac

Not that I can see ... open an issue on that at https://github.com/dotnet/cli/issues

Thanks Scidhar, this solve the problem!!!

But one thing I don't understand, my OSX has updated to the latest version, how come the open ssl is out of date? is this means any OSX machines need to take this action before running dotnet core?

But one thing I don't understand, my OSX has updated to the latest version, how come the open ssl is out of date?

Apple has deprecated OpenSSL in OS X (they have their own libraries to accomplish similar things) and are no longer updating the legacy version that ships in the box. This version is no longer supported by the OpenSSL maintainers, and so we made the decision to not link against it, but instead require a newer version that has to be installed manually.

is this means any OSX machines need to take this action before running dotnet core

Yes. We are looking to make this better, but I do not think we will fix this before RTM.

Thanks for your answers, this is really helpful. :laughing:

I've done everything listed here, including adding a nuget.config file, installing openssl, and adding the wildcard to the version number in project.json. I'm still experiencing the same issue.

My OS is El Capitan, version 10.11.5.

Errors:

log  : Restoring packages for /Users/cameron_jones/Volusion/documents/dev-training/Projects & Homework/Console Todos/project.json...
error: Unable to load the service index for source https://www.myget.org/F/aspnetcirelease/api/v3/index.json.
error:   The type initializer for 'Crypto' threw an exception.
error:   The type initializer for 'CryptoInitializer' threw an exception.
error:   Unable to load DLL 'System.Security.Cryptography.Native': The specified module could not be found.
error:    (Exception from HRESULT: 0x8007007E)

dotnet --info

.NET Command Line Tools (1.0.0-preview1-002702)

Product Information:
 Version:     1.0.0-preview1-002702
 Commit Sha:  6cde21225e

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.11
 OS Platform: Darwin
 RID:         osx.10.11-x64

It seems "brew link --force openssl" does not work. Im working with OSX 10.11.5 El Capitan with the following info.

`Product Information:
Version: 1.0.0-preview2-003121
Commit SHA-1 hash: 1e9d529bc5

Runtime Environment:
OS Name: Mac OS X
OS Version: 10.11
OS Platform: Darwin
RID: osx.10.11-x64`

See this SO link for more details http://stackoverflow.com/questions/38670295/brew-refusing-to-link-openssl

Was this page helpful?
0 / 5 - 0 ratings