Unable to locate Dependency NETStandard.Library >= 1.0.0-rc2-23616
On MAC OS X, I use "dotnet new" to create a new project, but get error when execute "dotnet restore".
I think this may be due to the recent upgrade in dotnet/cli#497 and the fact that this rc2 package doesn't exist in the default package source.
@hunter-xue if you do dotnet restore -s https://myget.org/f/dotnet-core do you see the same issue?
@blackdwarf @krwq
What libraries do you think should be referenced by default in the dotnet new template?
"dotnet restore -s https://myget.org/f/dotnet-core" is working for me, but "dotnet run" still get error below: Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'System.Console, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
@hunter-xue which version of OS X? El Capitan?
Hi there,
I note this issue isn't isolated to OSX, I have had the same problem on Windows with the current published MSI from https://dotnet.github.io/getting-started/. Its worth noting that I have installed several versions of the dotnet CLI over the past few weeks, so its possible the default endpoint had been configured from some previous version, or the NETStandard.Library simply hasn't been published to Nuget as of yet, not too sure.
Anyway, on Windows the dotnet restore -s https://myget.org/f/dotnet-core does pull the NETStandard.Library and dotnet run works fine once its down. So, that is a good work around for the time being, but it would be good to have this resolved, and possibly some clarity on package management moving forward, i assume Nuget is still the primary place to be resolving dependencies.
Anyway, thanks all, the platform is shaping up nicely :)
Thanks for the workarround. It's really hard to get used to the fact that one should look up his issue in github when its dotnet related. I'm so glad though... :smiley:
This problem is caused by NETStandard.Library package not being available on NuGet yet. For the time being it will only be available on Myget.
Fix for this issue is being tracked here: dotnet/cli#615
@blackdwarf My MAC OS X version is: EI Capitan 10.11.2
@hunter-xue, could you check if everything is working with the latest bits?
@krwq Yes, everything is the last bits. In fact, dotnet never worked on my MAC OS X.
I am seeing the same issue with Win 10 however the -s workaround does not work for me (see results in screenshot below).
I am able to open VS 2015 and let the restore happen from there. Even after the restore processes in VS I am unable to run the command line restore.
The error that I see without the -s workaround is ...
System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.Dnx.Tooling.Program.Main(String[] args)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.Dnx.Runtime.Common.EntryPointExecutor.Execute(Assembly assembly, String[] args, IServiceProvider serviceProvider)
at Microsoft.Dnx.Host.Bootstrapper.RunAsync(List`1 args, IRuntimeEnvironment env, String appBase, FrameworkName targetFramework)
at Microsoft.Dnx.Host.RuntimeBootstrapper.ExecuteAsync(String[] args, BootstrapperContext bootstrapperContext)
at Microsoft.Dnx.Host.RuntimeBootstrapper.Execute(String[] args, BootstrapperContext bootstrapperContext)

@TJSoftware could you provide more details? How did you install the CLI tools? Was it MSI or local install?
@blackdwarf Sorry, I started a post elsewhere with that info and then I found this and I forgot to replicate all that info here.
Summary
I followed the steps on dotnet getting started by downloading the exe and installing. After running dotnet new I was unable to execute dotnet restore with the error I gave previously.
Workaround
Opening Visual Studio 2015 ran the restore automatically. At that point I could run the command line dotnet run. Because the project.json does not have a commands section I am not able to run the project from VS after creating with dotnet new. I am not sure if that is something that needs to be done with the dotnet new process or not.
Tech Specs
.NET Version Manager v1.0.0-rc2-15546 Win 10 VS 2015
@TJSoftware There's no first class support for dotnet in visual studio. Anything you're doing today will be DNX based unless you know exactly the things to tweak (which are not documented anywhere). If you're still having trouble downloading the Standard library then your nuget feeds aren't configured to use the dotnet corefx feed.
@davidfowl Should I still be able to run the dotnet restore in command line? Because that is where I originally saw the error.
@TJSoftware, I can't seem to be able to repro.
- Are you using the freshest dotnet cli? ( https://github.com/dotnet/cli#installers )
- Do you have the freshest dotnet.exe in your environment var PATH and that you are running it? (use
where dotnetfor Windows andwhich dotnetfor other OSes)
Here is what I do:
dotnet new
dotnet restore
dotnet run
dotnet new should generate 3 files. Program.cs is a regular hello world. Project.json content should look like following:
{
"version": "1.0.0-*",
"compilationOptions": {
"emitEntryPoint": true
},
"dependencies": {
"NETStandard.Library": "1.0.0-rc2-23616"
},
"frameworks": {
"dnxcore50": { }
}
}
Nuget.config content should look like following:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<!--To inherit the global NuGet package sources remove the <clear/> line below -->
<clear />
<add key="dotnet-core" value="https://www.myget.org/F/dotnet-core/api/v3/index.json" />
<add key="api.nuget.org" value="https://api.nuget.org/v3/index.json" />
</packageSources>
</configuration>
Could you share if anything is different?
@krwq Thank you for attempting to replicate this. I downloaded the exe from the installers in the link you provided. First I did a repair and I still saw the issue. I then removed and reinstalled and I still see the issue. The exe that I downloaded and the link that you provided both have the revision number {107F8D22-2042-4C54-BBB6-9FBC2045A6A5}. I tested using both command prompt and powershell (both as administrator). See below for screenshots of my steps.
Based on your post my issue may be related to the environment variable. where dotnet gives me C:\Program Files\dotnet\bin\dotnet.exe. I have tried the following settings for DOTNET_HOME in the environment variable and I still receive the error. I clicked ok all the way out of the environment variables window to ensure that the variable is set.
C:\Program Files\dotnet\bin\dotnet.exe
C:\Program Files\dotnet\bin\
C:\Program Files\dotnet\bin
C:\Program Files\dotnet\
C:\Program Files\dotnet Original value after install of exe
/c/Program Files/dotnet/bin/dotnet
Thank you for confirming the state of what dotnet new creates. I realize now that I was not clear on what I was saying there. With the post from David Fowler it is more clear that the command in the project.json may or may not come at a later time, VS is just not in the bandwidth at this time for dotnet cli. I had previously expected that dotnet new was similar to a new VS empty project.

I noticed when I checked the environment variable from the command prompt that it was not returning the correct value. I used the set command this time. However, I still do not see this working, but perhaps I am using the wrong environment variable. You can see the screenshot below for a few tests where I set DOTNET_HOME to various paths that I tried in my previous post and confirm the path is set with an echo. Each time I do a dotnet restore and the error still exists.

dotnet restore currently uses dnx restore in the background. This looks like an error in dnx and shouldn't bre related to the DOTNET_HOME environment variable.
@anurse Have you seen this error before?
I created a new win 10 VM with nothing else on it. I downloaded the msi from https://github.com/dotnet/cli. I tested dotnet I received an error about a missing dll (sorry did not copy the message before fixing it). The fix was to install VS 2015 community. After installing VS I was able to use the dotnet restore. I am certain that my previous issues are just that I have previous dnx versions installed that are trashing the dotnet environment. I am not concerned with fixing that as it is unique to my environment.
On a side note, is it a requirement to have VS installed to run the dotnet command line tools? If so, would you like me to update the docs?
Thank you all for your help.
@TJSoftware the requirement for VS could be a point-in-time issue. @brthor @Sridhar-MS could this be related to native compilation and its requirements?