How to create a new project type in VS2010?

喜夏-厌秋 提交于 2019-12-03 06:53:24

问题


I've figured out how to create a new template, but I need a little more power than that. I need to override what happens when you click the "Run" button for example -- I want it to fire up a development server and then pop open my web browser.

So, how can I add an entirely new project type? And preferably, how can I base it on another project type, such as IronPython?

I know ASP.NET MVC is open source and is quite similar to what I'm trying to do, but I'm not sure if the source I downloaded includes all the VS integration code. Which download should I be looking at?


回答1:


Here's what I've found so far:

  • Download: Visual Studio 2010 SDK -- You need this to create a VSPackage (File > New Project > Other Project Types > Extensibility > Visual Studio Package)
  • Tutorial: A Simple Managed Project System
  • MSDN: Project Types
    • MSDN: Project Subtypes
  • Getting Started with Extending Visual Studio
    • Visual Studio SDK Projects
      • Walkthrough: Part 1 - Creating a Basic Project System
      • Walkthrough: Part 2 - Creating a Basic Project System



回答2:


What you want to do is create a project subtype / flavor. It will give you the control you need to customize this and other actions. But it is a fairly involved process that can't really be summed up in a SO answer box. But here's the main documentation page on the subject

  • http://msdn.microsoft.com/en-gb/library/bb166488(v=VS.80).aspx

Please do post back with any road blocks you hit.



来源:https://stackoverflow.com/questions/3713503/how-to-create-a-new-project-type-in-vs2010

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!