Retargeting solution from .Net 4.0 to 4.5 - how to retarget the NuGet packages?

前端 未结 5 1058
醉话见心
醉话见心 2020-11-29 14:44

I have migrated a solution that is currently targeting .NET 4.0 in VS2010 to VS2012 and now I would like to re-target it to .Net 4.5

What I am not sure about is the

5条回答
  •  北海茫月
    2020-11-29 15:43

    Whilst attempting to reinstall packages solution wide, I encountered a dependency error (in spite of using the -ignoreDependencies flag), and all the packages.config files for every project had been deleted. In VS2013, it seems that packages.config does not get flushed back to disk and re-added until all the upgraded dependencies/references are re-attached to the project.

    In my case what worked was to upgrade each project one-at-a-time by adding the -ProjectName projectname to the update-package command. In this case the packages.config is updated as each project is upgraded.

    May not be practical for very large solutions but it seems a reasonable compromise to still take advantage of the automated upgrade for as many projects as possible and isolate the problematic ones without having every packages.config in your solution deleted on failure.

提交回复
热议问题