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

The dependency Moq >= 4.7.8 could not be resolved #339

Closed
sakopov opened this issue Apr 13, 2017 · 3 comments
Closed

The dependency Moq >= 4.7.8 could not be resolved #339

sakopov opened this issue Apr 13, 2017 · 3 comments

Comments

@sakopov
Copy link

sakopov commented Apr 13, 2017

Trying to add Moq to an empty .NET Core class library project (NetStandard 1.6)

Getting "The dependency Moq >= 4.7.8 could not be resolved" upon restore.

project.json

{
  "version": "1.0.0-*",

  "dependencies": {
    "Machine.Specifications": "0.11.0",
    "Machine.Specifications.Should": "0.11.0",
    "Moq": "4.7.8",
    "NETStandard.Library": "1.6.1"
  },

  "frameworks": {
    "netstandard1.6": {
      "imports": "dnxcore50"
    }
  }
}

Any thoughts?

@kzu
Copy link
Member

kzu commented Apr 13, 2017

/cc @jeremymeng?

@kzu kzu closed this as completed Apr 13, 2017
@kzu kzu reopened this Apr 13, 2017
@jeremymeng
Copy link
Contributor

@sakopov what is the version of Visual Studio or .NET Core tooling
that you are using? How did you run restore?

Could you please run

dotnet restore

in a command line prompt in the directory where your project.json sits and share the output?

I just ran dotnet restore on your project.json from command line but
couldn't reproduce the issue. I probably have newer version of .NET Core SDK installed though.

C:\Temp\moq_test>dotnet --info
.NET Command Line Tools (1.0.0-preview2-003131)

Product Information:
 Version:            1.0.0-preview2-003131
 Commit SHA-1 hash:  635cf40e58

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.14393
 OS Platform: Windows
 RID:         win10-x64

C:\Temp\moq_test>dotnet restore -v Information
log  : Restoring packages for C:\Temp\moq_test\project.json...
info :   CACHE https://api.nuget.org/v3-flatcontainer/machine.specifications/index.json
info :   CACHE https://api.nuget.org/v3-flatcontainer/machine.specifications/0.11.0/machine.specifications.0.11.0.nupkg
info :   CACHE https://api.nuget.org/v3-flatcontainer/machine.specifications.should/index.json
info :   CACHE https://api.nuget.org/v3-flatcontainer/machine.specifications.should/0.11.0/machine.specifications.should.0.11.0.nupkg
info :   CACHE https://api.nuget.org/v3-flatcontainer/moq/index.json
info :   CACHE https://api.nuget.org/v3-flatcontainer/moq/4.7.8/moq.4.7.8.nupkg
info :   CACHE https://api.nuget.org/v3-flatcontainer/system.componentmodel.typeconverter/index.json
log  : Installing Moq 4.7.8.
log  : Installing Machine.Specifications.Should 0.11.0.
log  : Installing Machine.Specifications 0.11.0.
info : Committing restore...
log  : Writing lock file to disk. Path: C:\Temp\moq_test\project.lock.json
log  : C:\Temp\moq_test\project.json
log  : Restore completed in 1529ms.

NuGet Config files used:
    C:\Users\myumyu\AppData\Roaming\NuGet\NuGet.Config
    C:\ProgramData\nuget\Config\Microsoft.VisualStudio.Offline.config

Feeds used:
    https://api.nuget.org/v3/index.json
    j:\yumeng\nuget
    C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\

Installed:
    3 package(s) to C:\Temp\moq_test\project.json

@sakopov
Copy link
Author

sakopov commented Apr 13, 2017

Ah, jee. The problem was with Nuget. I had some package sources which are only available via VPN. So nuget was searching for Moq over all of the package sources even though I had explicitly told it to use nuget.org. Once I disabled those sources, it was able to pull in Moq w/o issues.

Sorry guys I will close this.

@sakopov sakopov closed this as completed Apr 13, 2017
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

3 participants