Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

ERROR: Nuget Restore: .net core 1.1/Angular #3033


User avatar
0
bseufert created

The new packages created for .net core 1.1 / Angular have a package incompatibility issue when nuget is doing the initial restore (Visual Studio 2017):

Package Microsoft.Composition 1.0.27 is not compatible with netcoreapp1.1 (.NETCoreApp,Version=v1.1). Package Microsoft.Composition 1.0.27 supports: portable-net45+win8+wp8+wpa81 (.NETPortable,Version=v0.0,Profile=Profile259)


5 Answer(s)
  • User Avatar
    0
    bseufert created

    OK, found the problem (through this post: <a class="postlink" href="https://github.com/dotnet/corefx/issues/18452">https://github.com/dotnet/corefx/issues/18452</a> )

    You are including Microsoft.VisualStudio.Web.CodeGeneration.Design in the Host project. removing this package fixes the Nuget Restore.

  • User Avatar
    0
    justinp created

    Awesome! Thanks for sharing the solution!

    Will this affect the core project's ability to generate MVC controllers?

  • User Avatar
    0
    bseufert created

    Weird, I tested adding a Webapi Controller using right-click Add Controller. First thing Visual Studio 2017 did was put Microsoft.VisualStudio.Web.CodeGeneration.Design (and all it's multiple dependencies) back into the Host project. then I had to attempt to create a controller a second time to add the controller, which worked.

    So.... remove it in order to get Nuget to restore the packages in the solution. then, if you wish to generate the controllers it will automatically add back in these dependencies.

    Personally, I will create the controller myself as the scaffolding doesn't inherit from <yourapp>ControllerBase.

    I'm not sure how this will impact builds using a CI process that automatically restores the Nuget packages.

    Personally, I don't like including packages in my server app who's purpose is to support development time processes.

    Fun :)

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    We fixed it by this commit <a class="postlink" href="https://github.com/aspnetboilerplate/aspnet-core-template/commit/7702de2ca92b8c424f25af059545674d8d8f9901#commitcomment-21915183">https://github.com/aspnetboilerplate/as ... t-21915183</a>.

    Can you also try that in your project ?

  • User Avatar
    0
    bseufert created

    I have tested these changes, and has resolved the issue.

    Thanks,

    Brent