Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to locate Dependency NETStandard.Library >= 1.0.0-rc2-23616 #4601

Closed
hunter-xue opened this issue Dec 17, 2015 · 33 comments
Closed

Unable to locate Dependency NETStandard.Library >= 1.0.0-rc2-23616 #4601

hunter-xue opened this issue Dec 17, 2015 · 33 comments
Assignees

Comments

@hunter-xue
Copy link

On MAC OS X, I use "dotnet new" to create a new project, but get error when execute "dotnet restore".

@brthor
Copy link
Contributor

brthor commented Dec 17, 2015

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?

@hunter-xue
Copy link
Author

"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.

@blackdwarf
Copy link

@hunter-xue which version of OS X? El Capitan?

@sinclairzx81
Copy link

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 :)

@sqeezy
Copy link

sqeezy commented Dec 18, 2015

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... 😃

@brthor
Copy link
Contributor

brthor commented Dec 18, 2015

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

@hunter-xue
Copy link
Author

@blackdwarf My MAC OS X version is: EI Capitan 10.11.2

@krwq
Copy link
Member

krwq commented Dec 19, 2015

@hunter-xue, could you check if everything is working with the latest bits?

@krwq krwq self-assigned this Dec 19, 2015
@hunter-xue
Copy link
Author

@krwq Yes, everything is the last bits. In fact, dotnet never worked on my MAC OS X.

@TJSoftware
Copy link

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)

image

@blackdwarf
Copy link

@TJSoftware could you provide more details? How did you install the CLI tools? Was it MSI or local install?

@TJSoftware
Copy link

@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

@davidfowl
Copy link
Member

@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.

@TJSoftware
Copy link

@davidfowl Should I still be able to run the dotnet restore in command line? Because that is where I originally saw the error.

@krwq
Copy link
Member

krwq commented Dec 22, 2015

@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 dotnet for Windows and which dotnet for 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?

@TJSoftware
Copy link

@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.

image
image

@TJSoftware
Copy link

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.

image

@brthor
Copy link
Contributor

brthor commented Dec 28, 2015

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?

@TJSoftware
Copy link

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.

@blackdwarf
Copy link

@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?

@brthor
Copy link
Contributor

brthor commented Dec 29, 2015

@blackdwarf I think we need to do some investigation of our dependencies on a vanilla box.

We do have a dependency on the c++ redistributable for most commands, but VS 2015 should only be required if actually doing native compilation.

@TJSoftware
Copy link

@brthor I recreated the VM to get the error I saw with just installing the msi from https://github.com/dotnet/cli and nothing else.

image

@brthor
Copy link
Contributor

brthor commented Dec 29, 2015

@TJSoftware Can you try installing the c++ redistributable?

https://www.microsoft.com/en-us/download/details.aspx?id=48145

I think this is the dependency which is missing.

@schellap Would there be any way to remove this dependency by static linking corehost?

@TJSoftware
Copy link

@brthor The link you gave me fixed the missing dll error.

@brthor
Copy link
Contributor

brthor commented Dec 29, 2015

Looks like this is already being tracked:
https://github.com/dotnet/cli/issues/195

@TJSoftware
Copy link

Thanks all for your help. I tested all the dotnet commands, they are all working as expected now. It seems I am always a few weeks behind on finding bugs 😉.

@brthor
Copy link
Contributor

brthor commented Dec 29, 2015

Great to hear everything is working 😄

@schellap
Copy link

Would there be any way to remove this dependency by static linking corehost?

I'll take care of that in my next PR for "CoreHost Servicing"

@blackdwarf
Copy link

Fixed with dotnet/cli#617 .

@ewolfman
Copy link

Still having a problem. With the latest from http://dotnet.github.io/getting-started/ when running dotnet restore I get an exception:

Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'Program' or one of its dependencies. The system cannot find the file specified.

It is followed by a crash:
crash

@midizyf
Copy link

midizyf commented Jan 20, 2016

@ewolfman: There seems to be an issue with the space in "Program Files". After fooling around with the -v option, I found that instead of "dotnet restore", it works by using corerun and quoting the path to the NuGet dll:
C:\src\Hack\DotNetCore>corerun "C:\Program Files\dotnet\bin\NuGet.CommandLine.XPlat.dll" restore --runtime win7-x86 --runtime win7-x64

@brthor
Copy link
Contributor

brthor commented Jan 20, 2016

@ewolfman @midizyf I belive this is related to #4593 where we are doing improper argument forwarding. I am working on a fix.

@ewolfman
Copy link

@midizyf your solution works well. Thanks.

@msftgits msftgits transferred this issue from dotnet/cli Jan 31, 2020
rainersigwald pushed a commit that referenced this issue Jul 20, 2020
…0200608.1 (#4601)

Microsoft.Build.Localization , Microsoft.Build
 From Version 16.7.0-preview-20305-05 -> To Version 16.7.0-preview-20308-01

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests