sdk: dotnet restore fails
This issue popped up this morning after the Microsoft.NETCore.App (>= 1.0.0) was upgraded to version 1 from RC2. The problem occurs when I run a dotnet restore as a VSTS build step as well as locally on my VS2015 box.
Steps to reproduce
run dotnet restore on a MVC website
Expected behavior
dotnet restore works
Actual behavior
Errors in S:\portal\src\portal.Web\Portal.Web.xproj
Version conflict detected for Microsoft.CodeAnalysis.Common.
Portal.Web (>= 1.0.0) -> Microsoft.NETCore.App (>= 1.0.0) -> Microsoft.CodeAnalysis.VisualBasic (>= 1.3.0) -> Microsoft.CodeAnalysis.Common (>= 1.3.0)
Portal.Web (>= 1.0.0) -> Microsoft.VisualStudio.Web.CodeGeneration.Tools (>= 1.0.0-preview1-final) -> Microsoft.VisualStudio.Web.CodeGeneration (>= 1.0.0-preview1-final) -> Microsoft.VisualStudio.Web.CodeGeneration.EntityFrameworkCore (>= 1.0.0-preview1-final) -> Microsoft.VisualStudio.Web.CodeGeneration.Core (>= 1.0.0-preview1-final) -> Microsoft.VisualStudio.Web.CodeGeneration.Templating (>= 1.0.0-preview1-final) -> Microsoft.VisualStudio.Web.CodeGeneration.Utils (>= 1.0.0-preview1-final) -> Microsoft.CodeAnalysis.CSharp.Workspaces (>= 1.3.0-beta1-20160429-01) -> Microsoft.CodeAnalysis.Workspaces.Common (= 1.3.0-beta1-20160429-01) -> Microsoft.CodeAnalysis.Common (= 1.3.0-beta1-20160429-01).
Package Microsoft.AspNetCore.Mvc 1.0.0 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package Microsoft.AspNetCore.Mvc 1.0.0 supports:
- net451 (.NETFramework,Version=v4.5.1)
- netstandard1.6 (.NETStandard,Version=v1.6)
One or more packages are incompatible with .NETCoreApp,Version=v1.0.
Feeds used:
https://api.nuget.org/v3/index.json
https://dotnet.myget.org/F/cli-deps/api/v3/index.json
https://dotnet.myget.org/F/dotnet-core/api/v3/index.json
Environment data
`dotnet --info` output:
.NET Command Line Tools (1.0.0-preview1-002702)
Product Information:
Version: 1.0.0-preview1-002702
Commit Sha: 6cde21225e
Runtime Environment:
OS Name: Windows
OS Version: 10.0.10586
OS Platform: Windows
RID: win10-x64
project.json file
{
"userSecretsId": "aspnet-FamilyPortal.Web-a9159440-714e-4476-81ad-8d47121b825f",
"dependencies": {
"Microsoft.NETCore.App": "1.0.0",
"Microsoft.AspNetCore.Razor.Tools": {
"version": "1.0.0-preview1-final",
"type": "build"
},
"Microsoft.EntityFrameworkCore.Tools": {
"version": "1.0.0-preview1-final",
"type": "build"
},
"Microsoft.VisualStudio.Web.CodeGeneration.Tools": {
"version": "1.0.0-preview1-final",
"type": "build"
},
"Microsoft.VisualStudio.Web.CodeGenerators.Mvc": {
"version": "1.0.0-preview1-final",
"type": "build"
},
"Microsoft.AspNetCore.Authentication.Cookies": "1.0.0",
"Microsoft.AspNetCore.Diagnostics": "1.0.0",
"Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.0.0",
"Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.0.0",
"Microsoft.AspNetCore.Mvc": "1.0.0",
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
"Microsoft.AspNetCore.StaticFiles": "1.0.0",
"Microsoft.EntityFrameworkCore.SqlServer": "1.0.0",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
"Microsoft.Extensions.Configuration.Json": "1.0.0",
"Microsoft.Extensions.Configuration.UserSecrets": "1.0.0",
"Microsoft.Extensions.Logging": "1.0.0",
"Microsoft.Extensions.Logging.Console": "1.0.0",
"Microsoft.Extensions.Logging.Debug": "1.0.0",
"Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0"
},
"tools": {
"Microsoft.AspNetCore.Razor.Tools": {
"version": "1.0.0-preview1-final",
"imports": "portable-net45+win8+dnxcore50"
},
"Microsoft.AspNetCore.Server.IISIntegration.Tools": {
"version": "1.0.0-preview1-final",
"imports": "portable-net45+win8+dnxcore50"
},
"Microsoft.EntityFrameworkCore.Tools": {
"version": "1.0.0-preview1-final",
"imports": [
"portable-net45+win8+dnxcore50",
"portable-net45+win8"
]
},
"Microsoft.Extensions.SecretManager.Tools": {
"version": "1.0.0-preview1-final",
"imports": "portable-net45+win8+dnxcore50"
},
"Microsoft.VisualStudio.Web.CodeGeneration.Tools": {
"version": "1.0.0-preview1-final",
"imports": [
"portable-net45+win8+dnxcore50",
"portable-net45+win8"
]
}
},
"frameworks": {
"netcoreapp1.0": {
"imports": [
"dotnet5.6",
"dnxcore50",
"portable-net45+win8"
]
}
},
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},
"runtimeOptions": {
"gcServer": true
},
"publishOptions": {
"include": [
"wwwroot",
"Views",
"appsettings.json",
"web.config"
]
},
"scripts": {
"prepublish": [ "npm install", "bower install", "gulp clean", "gulp min" ],
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
}
}
.nuget/Nuget.Config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<solution>
<add key="disableSourceControlIntegration" value="true" />
</solution>
<packageSources>
<!--To inherit the global NuGet package sources remove the <clear/> line below -->
<clear />
<add key="cli-deps" value="https://dotnet.myget.org/F/cli-deps/api/v3/index.json" />
<add key="dotnet-core" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
<add key="api.nuget.org" value="https://api.nuget.org/v3/index.json" />
</packageSources>
</configuration>
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 1
- Comments: 22
I’ve the same issu with VS2017 .Net Core SDK 1.1 Preview
I have resolved this issue by installing the release version of .net core available for download at http://www.dot.net. Here is what the final project.json output will look like (all tooling must be updated as well)
I think I found the issue: After migrating to 1.0 from RC2, your global.json is probably still specyfing an older runtime like this:
{ "projects": [ "src", "test" ], "sdk": { "version": "1.0.0-preview1-002702" } }here,
sdk.versionshould be changed to1.0.0-preview2-003121.@jowensboggs @GeorgDangl I’ve encountered the same issue. And yes, I have latest VS2015 upd 3 installed with latest tooling from https://www.microsoft.com/net/core#windows
Files were: DotNetCore.1.0.0-SDK.Preview2-x64.exe (told it is already installed, perfomed repair from installer) DotNetCore.1.0.0-VS2015Tools.Preview2.exe
Is it supposed to work with below
"Microsoft.NETCore.App": { "version": "1.0.0", "type": "default" },and I have 2 runtimes
"runtimes": { "centos.7.1-x64": { }, "win7-x64": { } }This is the part you need to look at in the project.json:
“Microsoft.NETCore.App”: { “version”: “1.0.0”, “type”: “platform” },
we had wildcards in some of our “version” fields.