Nuget - 包管理器控制台的编写工具(自定义 cmdlet)
我已经安装了 nuget 包管理器,并且我真的很喜欢 mvc-scaffold 扩展。我想为我的项目编写类似的工具。
有没有我可以学习的 nuget 的 API 参考或文档? TIA 寻求任何建议。
编辑: 问题已经得到“解答”(再次感谢),以下是一些可能有用的链接:
- http ://nuget.codeplex.com/releases/view/59864 - 包资源管理器(下载+查看包内有什么 - 感谢上帝在 mvc 脚手架 ps 脚本中的评论:))
- http://channel9.msdn.com/Series/mvcConf/mvcConf-2-Steve-Sanderson- MvcScaffolding - 来自 mvcConf2 的视频
- ,当然还有 Steve Sanderson 的博客:http://blog.stevensanderson.com/
I've installed nuget package manager and I really love mvc-scaffold extension. I would like to write similar tool for my projects.
Is there any API reference or some documentation for nuget I can learn from ? TIA for any suggestions.
Edit:
Question is already 'answered' (thx one more time), here are some links that can be helpful:
- http://nuget.codeplex.com/releases/view/59864 - package explorer (download + see what it's inside the package - thank God for comments in mvc scaffolding ps scripts :))
- http://channel9.msdn.com/Series/mvcConf/mvcConf-2-Steve-Sanderson-MvcScaffolding - video from mvcConf2
- and of course Steve Sanderson's blog : http://blog.stevensanderson.com/
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我编写了您在问题中提到的 MvcScaffolding 的当前版本。下面介绍了如何将 PowerShell cmdlet 添加到程序包管理器控制台:
请注意,实际上没有必要用 C# 编写 cmdlet 并调用 Import-Module。更简单的替代方法是在 PowerShell 中编写它们(请参阅 http://technet.microsoft. com/en-us/magazine/ff677563.aspx)并在 NuGet 包的 init.ps1 文件中内联定义它们。
或者,如果您的问题是如何将自定义脚手架添加到 MvcScaffolding(例如,您可以说“Scaffold MyCustomThing -somecustomparams”),则使用命令“Scaffold CustomScaffolder MyCustomThing”,然后编辑出现在的 PS1/T4 文件您的 CodeTemplates/Scaffolders 文件夹。我很快就会在博客上发布有关此内容的更多详细信息。
I wrote the current version of MvcScaffolding that you mention in your question. Here's how it adds PowerShell cmdlets to the Package Manager Console:
Note that it's not actually necessary to write your cmdlets in C# and call Import-Module. A simpler alternative is to write them in PowerShell (see http://technet.microsoft.com/en-us/magazine/ff677563.aspx) and define them inline in your NuGet package's init.ps1 file.
Or, if your question is about how to add custom scaffolders to MvcScaffolding (e.g., so you can say "Scaffold MyCustomThing -somecustomparams"), then use the command "Scaffold CustomScaffolder MyCustomThing", and then edit the PS1/T4 files that appear in your CodeTemplates/Scaffolders folder. I'll blog more details about this soon.