Ciel
Ciel

Reputation: 4440

dotnet restore - "not compatible with win7"

I am attempting to use dotnet restore on a dotnet core project, and it seems to work fine until the very end, when I suddenly get this weird message.

error: System.IO.IsolatedStorage 4.0.1-beta-23516 provides a compile-time reference assembly for System.IO.IsolatedStorage on DNXCore,Version=v5.0, but there is no run-time assembly compatible with win7-x64.

error: System.IO.IsolatedStorage 4.0.1-beta-23516 provides a compile-time reference assembly for System.IO.IsolatedStorage on DNXCore,Version=v5.0, but there is no run-time assembly compatible with win7-x86.

I have searched high and low for answers to this, but I'm totally lost. I've posted my project.json below for reference, as well as my nuget.config feeds.

nuget.config feeds

<packageSources>
    <add key="aspnet-core" value="https://www.myget.org/F/aspnetcidev/api/v3/index.json" />
    <add key="api.nuget.org" value="https://api.nuget.org/v3/index.json" />
    <add key="nuget.org" value="https://www.nuget.org/api/v2/" />
</packageSources>

project.json

{
    "webroot": "wwwroot",
    "version": "1.0.0-*",
    "dependencies": {

        "Microsoft.NETCore.Platforms": "1.0.1-*",
        "Microsoft.AspNetCore.Diagnostics": "1.0.0-*",
        "Microsoft.AspNetCore.IISPlatformHandler": "1.0.0-*",
        "Microsoft.AspNetCore.Mvc": "1.0.0-*",
        "Microsoft.AspNetCore.Mvc.TagHelpers": "1.0.0-*",
        "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-*",
        "Microsoft.AspNetCore.StaticFiles": "1.0.0-*",
        "Microsoft.Extensions.Configuration.Json": "1.0.0-*",
        "Microsoft.Extensions.Logging.Console": "1.0.0-*",
        "Microsoft.AspNetCore.Identity": "1.0.0-*"
    },
    "frameworks": {
        "dnx451": {
            "dependencies": {
                "Microsoft.AspNetCore.Mvc.Dnx": "1.0.0-*"
            }
        },
        "net451": { },
        "dnxcore50": {
            "imports": "portable-net451+win7+win8",
            "dependencies": {
                "NETStandard.Library": "1.0.0-*"
            }
        }
    },

    "publishExclude": [
        "node_modules",
        "bower_components",
        "**.xproj",
        "**.user",
        "**.vspscc"
    ],
    "exclude": [
        "wwwroot",
        "node_modules",
        "bower_components"
    ]
}

Update

I have cleared the following directories;

%userprofile%\.nuget %userprofile%\.dnx\packages %localappdata%\NuGet\v3-cache

Then I ran the updater at /scripts/obtain/ from the dotnet/cli/ repository with the following command...

.\install.ps1 -channel beta

Then I went back and did dotnet restore on my project, it does say that it worked, but I get the following warning.

warn : Detected package downgrade: Microsoft.Dnx.Compilation.CSharp.Abstractions from 1.0.0-rc2-16553 to 1.0.0-rc2-16552

Is there anything I can do about that?

Upvotes: 0

Views: 757

Answers (2)

MidiGlitch
MidiGlitch

Reputation: 11

The above answer is no longer valid with respect to the install.ps1 statement, but I cannot comment there:

The script name is now dotnet-install.ps1 and the parameters for channel are now: future, preview, and production with production being the most stable.

i.e.

dotnet-install.ps1 -channel production

EDIT: well for the moment -channel beta does still work and production does not exist yet, despite being listed in the source code :) the joys of pre-release software...

Upvotes: 0

Victor Hurdugaci
Victor Hurdugaci

Reputation: 28425

Your project looks totally fine and it restores without errors:

log  : Restore completed in 69790ms.
NuGet Config files used:
    D:\Temp\tempmvc\NuGet.Config
    C:\Users\victor\AppData\Roaming\NuGet\NuGet.Config
Feeds used:
   https://www.myget.org/F/aspnetcidev/api/v3/index.json
   https://api.nuget.org/v3/index.json
   https://www.nuget.org/api/v2/
Installed:
    279 package(s) to D:\Temp\tempmvc\project.json

You might have some newer packages from other feeds in the packages caches or you might be using the wrong version of dotnet cli. Make sure you install the CLI from the beta channel.

To clear the caches delete:

  • %userprofile%\.nuget
  • %localappdata%\NuGet\v3-cache

To install the CLI from the beta feed, run the script from here:

install.ps1 -channel beta

Upvotes: 2

Related Questions