切换回 packages.config [英] Switch back to packages.config
本文介绍了切换回 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.
我已经尝试过使用 Update
和 Reinstall
选项恢复包管理器控制台命令.他们不再生成 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.
推荐答案
你需要:
- 将空"
packages.config
文件添加到项目(即 示例,但没有单独的<package>
元素) - 卸载项目或关闭 vs 并在文本编辑器中打开
csproj
文件. - 从项目文件中删除所有
PackageReference
元素. - 确保项目文件中没有设置
<RestoreProjectStyle>
. - 在 VS 中重新打开项目.
- Add an "empty"
packages.config
file to the project (that is, xml as in the example but without individual<package>
elements) - Unload the project or close vs and open the
csproj
file in a text editor. - Remove all
PackageReference
elements out of the project file. - Make sure that
<RestoreProjectStyle>
is not set in the project file. - Reopen the project in VS.
这篇关于切换回 packages.config的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文