Skip to content

error NU1001: The dependency Microsoft.NETCore.App >= 1.0.1 could not be resolved #7409

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

Closed
zipswich opened this issue Dec 21, 2016 · 7 comments

Comments

@zipswich
Copy link

Steps to reproduce

Install ASP.NET Core + Angular 2 template for Visual Studio, create a new project with that template, then build the project.

Expected behavior

Finish building successfully.

Actual behavior

Failure

Environment data

dotnet --info output:
project.json(3,30): error NU1001: The dependency Microsoft.NETCore.App >= 1.0.1 could not be resolved.
project.json(10,41): error NU1001: The dependency Microsoft.NETCore.App >= 1.0.1 could not be resolved.
project.json(3,30): error NU1001: The dependency Microsoft.NETCore.App >= 1.0.0 could not be resolved.
project.json(10,41): error NU1001: The dependency Microsoft.NETCore.App >= 1.0.0 could not be resolved.
project.json(7,53): error NU1001: The dependency Microsoft.AspNetCore.AngularServices >= 1.0.0-* could not be resolved.
project.json(9,39): error NU1001: The dependency Microsoft.AspNetCore.Mvc >= 1.0.1 could not be resolved.
project.json(15,50): error NU1001: The dependency Microsoft.AspNetCore.Server.Kestrel >= 1.0.1 could not be resolved.
project.json(19,61): error NU1001: The dependency Microsoft.Extensions.Configuration.CommandLine >= 1.0.0 could not be resolved.

The following is the project.json:

{
  "dependencies": {
    "Microsoft.NETCore.App": {
      "version": "1.0.1",
      "type": "platform"
    },
    "Microsoft.AspNetCore.AngularServices": "1.0.0-*",
    "Microsoft.AspNetCore.Diagnostics": "1.0.0",
    "Microsoft.AspNetCore.Mvc": "1.0.1",
    "Microsoft.AspNetCore.Razor.Tools": {
      "version": "1.0.0-preview2-final",
      "type": "build"
    },
    "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
    "Microsoft.AspNetCore.Server.Kestrel": "1.0.1",
    "Microsoft.AspNetCore.StaticFiles": "1.0.0",
    "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
    "Microsoft.Extensions.Configuration.Json": "1.0.0",
    "Microsoft.Extensions.Configuration.CommandLine": "1.0.0",
    "Microsoft.Extensions.Logging": "1.0.0",
    "Microsoft.Extensions.Logging.Console": "1.0.0",
    "Microsoft.Extensions.Logging.Debug": "1.0.0",
    "Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0"
  },

  "tools": {
    "Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview2-final",
    "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final",
    "Microsoft.DotNet.Watcher.Tools": "1.0.0-preview2-final"
  },

  "frameworks": {
    "netcoreapp1.0": {
      "imports": [
        "dotnet5.6",
        "portable-net45+win8"
      ]
    }
  },

  "buildOptions": {
    "emitEntryPoint": true,
    "preserveCompilationContext": true
  },

  "runtimeOptions": {
    "configProperties": {
      "System.GC.Server": true
    }
  },

  "publishOptions": {
    "include": [
      "appsettings.json",
      "ClientApp/dist",
      "node_modules",
      "Views",
      "web.config",
      "wwwroot"
    ]
  },

  "scripts": {
    "prepublish": [
      "npm install",
      "node node_modules/webpack/bin/webpack.js --config webpack.config.vendor.js --env.prod",
      "node node_modules/webpack/bin/webpack.js --env.prod"
    ],
    "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
  },

  "tooling": {
    "defaultNamespace": "Color_Vision_Test_Angular"
  }
}
@litoshko
Copy link

I ran into the same issue.
I managed to successfully restore packages and build the project by changing one line in project.json:
line 7: "Microsoft.AspNetCore.AngularServices": "1.0.0-",
to the following:
"Microsoft.AspNetCore.AngularServices": "1.0.0-beta-
",

@zipswich
Copy link
Author

Thank you for the tip. I tried that, but it did work.
Then I did a slew of other things (update packages, install Microsoft.NETCore.App package, then uninstall it, etc.), and now it works. I am not sure what fixed it. My guess is updating some NuGet packages.

@weitzhandler
Copy link

@litoshko
That solved the problem.
Thanks man!

@blackdwarf
Copy link

Since it seems that this issue was due to the incorrect package name and that the issue has been resolved, I will close it. Please reopen if you run into this again.

@adrobson
Copy link

Don't forget to try Restore Packages (right mouse click on project) !!. I had seemingly endless problems as the template kept failing upon first load. There were always two packages that failed - Microsoft.Extensions.Configuration.CommandLine and Microsoft.AspNetCore.AngularServices. After a dozen uninstall and install of the dotnetcore framework and tools and a few reinstalls of Visual Studio the situation had not changed. I finally tried right mouse clicking on the project and selecting Restore Packages. It then worked. I'm not sure if anything else I did along the way actually changed anything.

@as-ghub
Copy link

as-ghub commented Jul 7, 2017

Clear the contents of project.lock.json file and save.It will restore the packages once again , this should be a good workaround. It worked for me!

@gauravjoshi18
Copy link

I solve the same problem in my project by

Tools -> NuGet Package Manager -> Package Manager Console
Select required project from 'Default Project' list
Run the command "dotnet restore" on Package Manager Console
Rebuild the your project again this will solve your problem

@msftgits msftgits transferred this issue from dotnet/cli Jan 31, 2020
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

7 participants