The project was restored using Microsoft.NETCore.App version 2.1.0, but with current settings, version 2.1.0-rtm-26515-03 would be used instead

后端 未结 6 694
一个人的身影
一个人的身影 2020-12-08 13:06

at the moment I have a microservice made in c # with web api and net core 2.0

in the nutget packages I have already found a version 2.1 of net core and I have decide

6条回答
  •  难免孤独
    2020-12-08 13:42

    I wanted to publish an ASP.NET Core 2.1 Console app and got errors about colliding versions 2.1.0 and 2.1.6.

    Since I had lot of projects in my solution (and VS did not give me any hints on which projects were problematic, I created a file Directory.Build.props with the following contents and placed it in the directory where my .sln file was

    
      
        true
        true
        latest
      
    
    

    The important thing here is the entry.

    This way, all the projects use the same settings and I did not have to synchronize those manually.

    Doc of Directory.Build.props is here https://docs.microsoft.com/en-us/visualstudio/msbuild/customize-your-build?view=vs-2017

提交回复
热议问题