Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Package Restore Failed / .Net Core Install Bug

After installing Vs 2015 Community & DotNetCore.1.0.0-VS2015Tools.Preview2.0.1.exe (.Net Core), I tried to create a new .Net Core app & keep getting the 'Package Restore Failed' message.

I was about to reinstall the Win 10 since reinstalling Visual studio didn't help but saw this happens on both of my computers.

Anyone know how to fix this, please?

enter image description here

like image 203
myfunnyfella Avatar asked Aug 14 '16 22:08

myfunnyfella


1 Answers

I have the same issue in previous version of Visual Studio 2015 but it works fine in both of my Visual Studio Community 2015 and Visual Studio Enterprise 2015 with Update 3 (include KB3165756). So make sure your Visual Studio Community 2015 has installed the latest Update.

And according to the error message, one of the dependency System.IO.MemoryMappedFiles 4.0.0 does not support .NETCoreApp version 1.0. I suggest you check the project.json file in your .NET Core app, where stored all packages that installed for the default .NET Core app. Following are all my packages that installed in my default .NET Core app, please make sure all these package versions are the same with them in your app. You could copy them to your project.json file, after saving the file, these packages will be installed automatically.

{
  "dependencies": {
    "Microsoft.NETCore.App": {
      "version": "1.0.0",
      "type": "platform"
    },
    "Microsoft.AspNetCore.Diagnostics": "1.0.0",
    "Microsoft.AspNetCore.Mvc": "1.0.0",
    "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.0",
    "Microsoft.AspNetCore.StaticFiles": "1.0.0",
    "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
    "Microsoft.Extensions.Configuration.Json": "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",
    "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0"
  },
like image 96
Weiwei Avatar answered Nov 15 '22 12:11

Weiwei