Skip to content

Commit

Permalink
Update dotnet core osx instructions to symlink
Browse files Browse the repository at this point in the history
  • Loading branch information
joshka committed Aug 18, 2016
1 parent ea071ac commit fed667f
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions _posts/2016-08-03-installing-dotnet-osx.md
Expand Up @@ -5,8 +5,12 @@ date: 2016-08-03 19:31:00 -0500
categories:
---

**Update 2016-08-18:** replaced rpath with linking

The easiest way to install [.NET Core](https://www.microsoft.com/net/core#macos)
on OSX is a little different than the way currently suggested on the official site. I suggest using [Homebrew](http://brew.sh), and [Homebrew Cask](http://caskroom.io).
on OSX is a little different than the way currently suggested at the Previous
link. I suggest using [Homebrew](http://brew.sh), and
[Homebrew Cask](http://caskroom.io).

## Instructions

Expand All @@ -16,22 +20,21 @@ If you have not already installed Homebrew, install it.
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
```

Install dotnet using caskroom. This will also automatically install openssl if it's not already installed.
Install dotnet using caskroom. This will also automatically install openssl if
it's not already installed.

```console
$ brew update
$ brew tap caskroom/cask
$ brew cask install dotnet
```

By default, the installation of .NET Core links the crypto library to a folder location other than the Homebrew default. To fix the link to the openssl libraries run the following.
Note: this will work completely once
[homebrew-cask#23854](https://github.com/caskroom/homebrew-cask/pull/23854) is
merged. Until then, follow the part of instructions that link the 1.0.0 versions
of openssl to your `/usr/local/lib` folder.

```console
$ sudo install_name_tool -add_rpath \
$(brew --prefix openssl)/lib \
/usr/local/share/dotnet/shared/Microsoft.NETCore.App/1.0.0/System.Security.Cryptography.Native.dylib
$ ln -s /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/
$ ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib /usr/local/lib/
```

## Rationale

The [current installation instructions](https://www.microsoft.com/net/core#macos) suggest symlinking openssl libraries installed by Homebrew to `/usr/local/lib`. This approach is not the best, as it has the potential to cause security issues or cause software that's installed outside the Homebrew ecosystem to break. Previous instructions called on users to run `brew link openssl --force`, which Homebrew recently disabled specifically to avoid these issues.

0 comments on commit fed667f

Please sign in to comment.