I'm having an error restoring dependencies for an ASP.NET 5/ASP.NET Core 1.0.
It appears that a couple of the dependencies (namely Microsoft.CodeAnalysis.CSharp
/ .Common
) of Microsoft.AspNet.Mvc
are fixed to seemingly out of date packages.
A requirement for this is to use the dotnet
cli tool and target both .NET Vanilla and .NET Core.
Is there any way to get Mvc to reference Core-compatible version of CodeAnalysis?
Steps to reproduce in Visual Studio 2015 (v14.0.24729.00 Update 1):
dotnet restore
Output:
info : Restoring packages for C:\PATH_TO_SOLUTION\WebApplication2\src\WebApplication2\project.json...
error: Microsoft.CodeAnalysis.CSharp 1.1.0-rc1-20151109-01 is not compatible with DNXCore,Version=v5.0.
error: Microsoft.CodeAnalysis.Common 1.1.0-rc1-20151109-01 is not compatible with DNXCore,Version=v5.0.
error: Some packages are not compatible with DNXCore,Version=v5.0.
error: Microsoft.CodeAnalysis.CSharp 1.1.0-rc1-20151109-01 is not compatible with DNXCore,Version=v5.0 (win7-x64).
error: Microsoft.CodeAnalysis.Common 1.1.0-rc1-20151109-01 is not compatible with DNXCore,Version=v5.0 (win7-x64).
... (loads more errors) ...
project.json
file contains:
{
...
"dependencies": {
...
"Microsoft.AspNet.Mvc": "6.0.0-rc1-final",
...
}
...
"frameworks": {
"dnx451": { },
"dnxcore50": { }
},
...
}
Using the (currently) latest stable version works with as target framework only dnxcore50. In my project.json:
"Microsoft.CodeAnalysis.Common": "1.1.1",
"Microsoft.CodeAnalysis.CSharp": "1.1.1"
Just installing the latest version of Microsoft.CodeAnalysis.Common
from NuGet Package Manager worked fine for me.
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