Install dotnet package following this tutorial in Elementary OS environment, then try running dotnet restore
Downloading every dependency.
List of errors like:
<library> provides a compile-time reference assembly for <library> on DNXCore,Version=v5.0, but there is no run-time assembly compatible with elementary os.0.3.2-x64
dotnet --version output:
.NET Command Line Tools (1.0.0-beta-001634)
Product Information:
Version: 1.0.0-beta-001634
Commit Sha: N/A
I changed the /etc/os-release string to match the Ubuntu one. Anyway, Elementary OS i Ubuntu 14.04 based, why isn't it accepted by dotnet then?
@poculeka though Elementary OS could be derived from Ubuntu, we don't really test out CLI on anything but CentOS and Ubuntu for now.
Elementary OS is based on Ubuntu 14.04. It just has a different desktop and core desktop apps. Anything that dotnet deals with is going to be identical to Ubuntu 14.04 other than /etc/os-release. So really the bug here is not that elementary OS doesn't work, but rather that dotnet is using /etc/os-release to determine which packages to download.
It seems to me that if you install dotnet from a ppa, then when you run dotnet restore it should download nuget packages that are compatible with the dotnet version that was installed and not be looking at something outside of the dotnet package to determine which nuget packages are compatible.
+1 here
Elementary OS is ubuntu 14.04 based, it even shares ubuntu's package repos... is there a way to tell the CLI to treat is as ubunut 14.04?
it is using the same binaries from Canonical, compiled by Canonical after all. Just another desktop and apps.
As mentioned above, you can edit /etc/os-release.
I also did a little digging and found this: https://github.com/dotnet/corefx/blob/master/pkg/Microsoft.NETCore.Platforms/runtime.json. It has Linux Mint already, so maybe adding elementary OS might be a possibility.
@dlech @luisgarciaalanis even though Elementary OS is something that is based off of Ubuntu, as @dlech found out, we need to have a RID for it. Since we don't, we cannot restore. This has nothing to do with the version of the CLI toolset. This is how packages on NuGet work.
What would be good is for us to figure out how to help get these distros in, that is, what would be a good and sustainable process for adding at least those distros that are, like Elementary and Mint, straightforward compatible with their parent distros. There is no process like that yet, we have to figure it out.
It looks like NuGet is changing already: https://github.com/NuGet/NuGet.Client/pull/391
I got a bit farther by following this suggestion. If I use just
"runtimes": {
"ubuntu-x64": {}
}
... in project.json, then dotnet restore completes successfully but dotnet run fails with
Can not find runtime target for framework 'DNXCore,Version=v5.0' compatible with one
of the target runtimes: 'elementary os.0.3.2-x64'. Possible causes:
1. The project has not been restored or restore failed - run `dotnet restore`
2. The project does not list one of 'elementary os.0.3.2-x64' in the 'runtimes' section.
Obviously this is because of 2. If I use...
"runtimes": {
"ubuntu-x64": {},
"elementary os.0.3.2-x64": {}
}
dotnet restore will complain about
Some packages are not compatible with DNXCore,Version=v5.0 (elementary os.0.3.2-x64).
but dotnet run will actually compile
Compiling hwapp for DNXCore,Version=v5.0
Compilation succeeded.
0 Warning(s)
0 Error(s)
Time elapsed 00:00:01.8479797
Could not resolve coreclr path
but it still doesn't run.
One possibility might be to take advantage of the ID_LIKE property in /etc/os-release. If it matches any of the runtimes in project.json, then go with that one. For example, elemetary OS has ID_LIKE=ubuntu. Since ubuntu matches ubuntu-x64 in the project runtimes, this seems like it could be made to work.
Actually, I've just tried this on a VM that has Freya x64 on it. Installed Ubuntu 14.04 bits using the https://dot.net/core#ubuntu instructions and it worked like a charm.
In general, if you are running a binary derivative of one of the supported distros (like Elementary OS is a direct derivative of Ubuntu 14.04) your best bet is to install the binaries available for the "root" distro if it is supported.
Closing this now.
If this is a binary-compatible distro but reports it's own name in /etc/os-release, then I think we should add it to the rid graph so that all restore and publish scenarios work. You can publish standalone things for ubuntu14.04 and use the ubuntu14.04 SDK, but I think some things will still be broken, like publishing.
@ericstj
@mellinoe / @schellap / @anurse I think we need the host and CLI to behave in a consistent way and as I mentioned in https://github.com/dotnet/core-setup/issues/229 the host is hardcoding, but apparently CLI is trying to calculate. Those algos need to be consistent since the host is trying to replay the RID selection at runtime for the portable case.
@mellinoe when you say this would impact publishing, do you mean the functioning of dotnet publish command or its results? For instance, I can imagine how not having a RID baked in would hurt self-contained scenario. However, for portable apps, this should not be a problem, correct?
Sorry, I guess I mis-spoke. I meant the dotnet publish command itself I think it will be a problem whenever the CLI tries to run or publish something with the machine's "current RID", since we don't understand this RID. Isn't there also a problem with trying to run portable apps, since your own RID will be unknown?
I starred this a while back when I ran into trouble. I was and still am a relative newbie with Linux. I ran into the issues originally mentioned on this article. Thought I'd throw my two cents in and say that the recent activity prompted me to throw together a VM with ElementaryOS and follow the directions on the .NET Core site for getting Ubuntu 1404 running. Was able to get a project build, added json.net and ran restore, build, run and publish with zero issues.
In fact it was easier for me than changing the screen resolution.
Most helpful comment
Elementary OS is based on Ubuntu 14.04. It just has a different desktop and core desktop apps. Anything that dotnet deals with is going to be identical to Ubuntu 14.04 other than
/etc/os-release. So really the bug here is not that elementary OS doesn't work, but rather that dotnet is using/etc/os-releaseto determine which packages to download.It seems to me that if you install
dotnetfrom a ppa, then when you rundotnet restoreit should download nuget packages that are compatible with the dotnet version that was installed and not be looking at something outside of the dotnet package to determine which nuget packages are compatible.