I have finally managed to get a project's dependencies downloaded with dotnet restore
, after going through the process of clearing all nuget
cache, dnx
cache, and updating the cli
using the beta channel.
But using the project.json
below, I get an error;
warn : Detected package downgrade: Microsoft.Dnx.Compilation.CSharp.Abstractions from 1.0.0-rc2-16553 to 1.0.0-rc2-16552
I'm not sure what this means, or how to fix it. The things still download, but this concerns me.
I am using the following;
.NET Command Line Tools (1.0.0-beta-001540)
Product Information:
Version: 1.0.0-beta-001540
Commit Sha: 6aeed1f52d
Runtime Environment:
OS Name: Windows
OS Version: 10.0.10586
OS Platform: Windows
Runtime Id: win10-x64
Active Version Runtime Architecture OperatingSystem Alias
------ ------- ------- ------------ --------------- -----
1.0.0-rc1-update1 clr x64 win
1.0.0-rc1-update1 clr x86 win
1.0.0-rc1-update1 coreclr x64 win
1.0.0-rc1-update1 coreclr x86 win
1.0.0-rc2-16551 clr x86 win
* 1.0.0-rc2-16551 coreclr x64 win default
1.0.0-rc2-16551 coreclr x86 win
<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>
{
"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"
]
}
The solution is to update or delete the existing dependency that is in your project prior to installing the package. Example: Detected package downgrade: Newtonsoft.Json from 9.0.0 to 8.0.0.
The dotnet remove package command provides a convenient option to remove a NuGet package reference from a project.
When executing the command from the folder where the app's DLL resides, simply execute dotnet my_app.dll. If you want to use a specific version of the.NET Runtime, use the --fx-version <VERSION> option (see the dotnet command reference). When you supply a command to the driver, dotnet.exe starts the CLI command execution process.
Install a specific version by appending --version <VERSION> to your command. See the Update section of the dotnet tool documentation for more details. Before using the tools, you might have to create a startup project or set the environment. The commands refer to a project and a startup project.
One of the libraries explicitly require 1.0.0-rc2-16552 version, that's why you get the warning. Once the library u[grade to supports higher version warnings will disappear. This is an old post so not sure which library is doing this at the time of your post, but for people with same warning, go through your libraries and look which one has version dependency. Basically, remove the library or stay on downgraded version until the library updates and supports the new version.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With