切换回 packages.config [英] Switch back to packages.config

查看:19
本文介绍了切换回 packages.config的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以切换回 packages.config 方案?我在创建项目时迁移到 PackageReference 方案,但由于某些原因现在需要迁移到旧的方式.

Is it possible to switch back to packages.config scheme of things? I moved to PackageReference scheme when I created the project, but for some reasons need to move to old way of things now.

我已经尝试过使用 UpdateReinstall 选项恢复包管理器控制台命令.他们不再生成 packages.config 了.我也切换了 Tools >选项>NuGet 包管理器packages.config.不好.

I have tried Package Manager Console commands like restore with Update and Reinstall options. They do not generate packages.config anymore. I also switched Tools > Options > NuGet Package Manager to packages.config. No good.

推荐答案

你需要:

  1. 将空"packages.config 文件添加到项目(即 示例,但没有单独的 <package> 元素)
  2. 卸载项目或关闭 vs 并在文本编辑器中打开 csproj 文件.
  3. 从项目文件中删除所有 PackageReference 元素.
  4. 确保项目文件中没有设置 <RestoreProjectStyle>.
  5. 在 VS 中重新打开项目.
  1. Add an "empty" packages.config file to the project (that is, xml as in the example but without individual <package> elements)
  2. Unload the project or close vs and open the csproj file in a text editor.
  3. Remove all PackageReference elements out of the project file.
  4. Make sure that <RestoreProjectStyle> is not set in the project file.
  5. Reopen the project in VS.

这篇关于切换回 packages.config的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆