且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在 Visual Studio 2005 中使用 NuGet

更新时间:2023-01-13 08:13:34

Scott Hanselman 博客 关于向 Visual Studio 2008 添加 NuGet支持".您也可以稍微调整一下以在 Visual Studio 2005 中工作,但当然您不会获得与在 Visual Studio 2010 中相同的体验.

Scott Hanselman blogged about adding NuGet "support" to Visual Studio 2008. You can probably adapt this slightly to work in Visual Studio 2005 too, though of course you won't get the same experience as in Visual Studio 2010.

嗯,不是真的.更好的标题是如何拼凑在一起带有外部工具的 Visual Studio 2008 的 NuGet 支持和祈祷." 重点是,有很多人在使用 Visual Studio2008 谁想要 NuGet 支持.我正在探索这个区域并且有实现它的六种方法,有些困难,有些不那么容易.这个想法是用最少的努力来启用一些东西.这将是看看社区中是否有人认为这很有趣重要到足以让它发生.当然,最简单的事情是只使用 2010,因为它仍然支持 .NET 2.0、3.0、3.5 和4,但不是每个人都可以升级.

Well, not really. A better title would be "How to Cobble Together NuGet Support for Visual Studio 2008 with External Tools and a Prayer." The point is, there are lots of folks using Visual Studio 2008 who would like NuGet support. I'm exploring this area and there's a half-dozen ways to make it happen, some difficult and some less so. The idea would be to enable some things with minimal effort. It'll be interesting to see if there are folks in the community who think this is important enough to actually make it happen. Of course, the easiest thing is to just use 2010 as it sill supports .NET 2.0, 3.0, 3.5, and 4, but not everyone can upgrade.

有人可以:

  • 使用将现有的 NuGet 包引用对话框向后移植到 2008该版本的原生扩展(不是 VSiX)
  • 创建 MEF(托管可扩展性框架)插件,用于 nuget.exe 命令行更新 vbproj 或 csproj 中的引用
  • 使用 PowerShell 脚本和批处理文件以使最基本的东西工作(获取一个包和更新参考.)
    • 也许编写一个 shim 来实现 DTE 自动化工作...

    但那是可能的.让我们谈谈 MacGyver解决方案.更多»

    But that's coulds and maybes. Let's talk about the MacGyver solution. more »