编写一个自定义向导,将文件从 Nuget 包文件夹复制到模板中
如果您查看 .NET MVC 类,在创建新的 MVC 项目时,JQuery 和其他文件会从模板添加到新创建的项目中。我需要做类似的事情。我研究过这篇博客文章: http://haacked.com/archive/2011/06/06/creating-a-custom-asp-net-mvc-project-template.aspx 并尝试执行建议的操作,但是,博客文章警告:该包必须存在于 %ProgramFiles%\Microsoft ASP.NET\ASP.NET MVC 3\Packages 文件夹中。这对于我的应用程序来说是不可能的,所以我认为我需要编写自己的自定义向导,根据包的路径添加文件和对我的项目的引用。我该怎么做呢?
If you look at the .NET MVC class, JQuery and other files are added to the newly created project from the template when create a new MVC project. I need to do something similar. I've studied this blog post: http://haacked.com/archive/2011/06/06/creating-a-custom-asp-net-mvc-project-template.aspx and attempted to do what is advised, however, the blog post warns: The package must exist in the %ProgramFiles%\Microsoft ASP.NET\ASP.NET MVC 3\Packages folder. This isn't a possibility for my application, so I think I need to write my own custom wizard that adds files and references to my project based on a path to packages. How should I go about doing this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您将能够在 NuGet 1.5 中执行此操作。有关更多信息,请参阅此博客文章:
http:// /blogs.msdn.com/b/marcinon/archive/2011/07/08/project-templates-and-preinstalled-nuget-packages.aspx
You'll be able to do this in NuGet 1.5. For more information see this blog post:
http://blogs.msdn.com/b/marcinon/archive/2011/07/08/project-templates-and-preinstalled-nuget-packages.aspx