locked
Custom Project Guids RRS feed

  • Question

  • Hi All,

     I want to have my Project Type Guid like the one below.

    MyProject     {BF6DA216-47D7-49F3-AFBD-4A48FDC58538}

    Project Type Description

     

    Project Type Guid

     

    Windows (C#)

     

     

    {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}

     

     

    Windows (VB.NET)

     

     

    {F184B08F-C81C-45F6-A57F-5ABD9991F28F}

     

     

    Windows (Visual C++)

     

     

    {8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}

     

     

    Web Application

     

     

    {349C5851-65DF-11DA-9384-00065B846F21}

     

     

    Web Site

     

     

    {E24C65DC-7377-472B-9ABA-BC803B73C61A}

     

     

     

    Also to this My Project I want to add my Custom Item Templates. What should i do to achieve this.

    Note: MyProject I'm creating from by using IWizard interface.

     

    Thanks

    Tuesday, November 9, 2010 3:41 PM

Answers

  • Hi Mohi,

    I don't understand what you mean when you say you want "to have an entry into the Registry like the one we have for Windows, Web and Database kind of projects.".

    The <ProjectTypeGuids> tag in a .csproj file denotes the base project type (C#, VB, etc), in addition to one or more project flavors (aka project subtypes, like WCF, WPF, etc). If the packages supporting these project types are installed, you should not require any sort of registry entries, as they would have been installed in the course of registering the package.

    Can you elaborate a bit more on what you are attempting to do with your project templates here? Are you trying to create a custom category in the New Project dialog to place your templates under? For example, the CSharp\Windows category or the Database\SQL Server category?

    Thanks,


    Ed Dore
    • Proposed as answer by Victor_Chen Thursday, November 25, 2010 3:29 AM
    • Marked as answer by Victor_Chen Friday, November 26, 2010 3:08 AM
    Wednesday, November 17, 2010 2:48 AM
  • Hi Mohi,

     

    Sorry for the delay.

    As Ed mentioned before, what you need to implement are subtypes but not templates.

    I noticed that you have complete the first step, a custom project type, very well.

    And the next step is to create its subtypes, all subtypes are individual packages with own project factory and nodes.

    There is a subtype sample in VS2005 SDK, you can download it for reference.

    Also I'm working on a C# subtype sample for 2010, and I will share it when I finish.

    Hope this can help.

     

    Best Regards,

    Ziwei Chen

    • Proposed as answer by Victor_Chen Thursday, November 25, 2010 3:43 AM
    • Marked as answer by Victor_Chen Friday, November 26, 2010 3:08 AM
    Thursday, November 25, 2010 3:07 AM

All replies

  • Hi Mohi,

     

    Thanks for your post.

    I saw your last post today and I'm sorry that I was on a vacation last week.

    As far as I know, If you'd like each custom project has its own GUID, that means all of them are not templates but Project Subtypes.

    Here is a tutorial for subtype development for reference.

    http://mgolchin.blogspot.com/2009/07/project-subtypes.html

    I suppose you have being working on this project for several months, and I'm also interested on this project and wish to help complete it.

    For the custom item appearance issue.

    Is it possible to share this project with me via SkyDrive, and I will try my best to figure this out as soon as possible.

    Looking forward to your reply.

     

    Best Regards,

    Ziwei Chen

     

     

    Thursday, November 11, 2010 2:56 AM
  • Hi Chen,

      I have uploaded a Sample project on Skydrive, it contains one Class Library that will invoke the RunStarted method of IWizard interface, C# Project Template for Displaying in File->New Project Dialog, and a VSPackage. 

    I want to register each project(Project1, Project2, Project3, ..5) as Project Type Guid  in the registery.

    I can able to generate the projects but could not register them in the registery.

    Thanks,
    Mohi
    Sunday, November 14, 2010 9:16 PM
  • Please go to the following link to download the file

     

    http://www.mediafire.com/?slksp82p3fat84x

     

    Thanks

    Sunday, November 14, 2010 9:20 PM
  • Hi Mohi,

     

    Thanks for sharing.

    I've downloaded your code and noticed all of them are templates.

    As I mentioned before, just project types can have project type GUID, templates have the same GUID of their project types.

    If I misunderstand your issue, be free to let me know.



    Best Regards,

    Ziwei Chen

     

     

     

    Tuesday, November 16, 2010 9:58 AM
  • Hi Chen,

      I really appreciate your help, All the projects are templates and there is one parent template that will invoke the Wizard gets the choice and generates the project in the ProjectFinishedGenerating method of the  IWizard interface.

    i have inserted ProjectTypeGuids for the projects in the .csproj files of (Project1, Project2, project3...5) but i want them to have an entry into the Registery like the one we have for Windows, Web, Database kind of projects.

    Thanks,

    Mohi

     

    Tuesday, November 16, 2010 5:02 PM
  • Hi Mohi,

    I don't understand what you mean when you say you want "to have an entry into the Registry like the one we have for Windows, Web and Database kind of projects.".

    The <ProjectTypeGuids> tag in a .csproj file denotes the base project type (C#, VB, etc), in addition to one or more project flavors (aka project subtypes, like WCF, WPF, etc). If the packages supporting these project types are installed, you should not require any sort of registry entries, as they would have been installed in the course of registering the package.

    Can you elaborate a bit more on what you are attempting to do with your project templates here? Are you trying to create a custom category in the New Project dialog to place your templates under? For example, the CSharp\Windows category or the Database\SQL Server category?

    Thanks,


    Ed Dore
    • Proposed as answer by Victor_Chen Thursday, November 25, 2010 3:29 AM
    • Marked as answer by Victor_Chen Friday, November 26, 2010 3:08 AM
    Wednesday, November 17, 2010 2:48 AM
  • Hi Ed Dore,

    Yes you are right I'm trying to create like this kind of format for my project system(Mohi/MyProjects). Mohi will be acting like CSharp and My Projects like WCF, WPF, etc... but it will have my own project subtypes like Proj1, Proj2, Proj3...

    I have 5 Templates all the .csproj files have no guids basically. So I inserted my own guids inside the .csproj files. like the one we have for WorkFlow Type of Project.

    <ProjectTypeGuids>{14822709-B5A1-4724-98CA-57A101D1B079}; {FAE04EC1-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>

    I have a Wizard that can generate 5 Projects by using those template files. user can make a selection and choose any one project to generate

    ----------------------------------------------------------

    |Wizard Form to Generate Projects from Template Files|

    |           Generate Project1(proj1.vstemplate)       |

    |           Generate Project2(proj2.vstemplate)       |

    |           Generate Project3(proj3.vstemplate)       |

    |           Generate Project4(proj4.vstemplate)       |

    |           Generate Project5(proj5.vstemplate)       |

    |                        | Okbutton |         |Cancel|        |

    ---------------------------------------------------------

    this Wizard gets invoke from Runstarted Method of IWizard Interface.

    Im not sure how can i create project factory type of Application and invoke the wizard using IWizard interface.

    Should I create package with the templates. If i create the project factory for each of the project how can i generate that project using the Wizard if i create the package.

    I Hope you understand what I'm trying to do. please go to this link and download a sample

    http://www.mediafire.com/?slksp82p3fat84x

    Thanks,

    Mohi

     

    Wednesday, November 17, 2010 7:04 PM
  • Hi Mohi,

     

    Thanks for your reply.

    I suppose you'd like to register the template as a project type with ProjectTypeGUID into the registry.

    As you mentioned Windows, Web, Database are project types or SubTypes but not Project Templates, I don't think it is possible to register the template as a project type.

    But I think there must be some workarounds for your need and RegisteredProjectType would help.

    Could you please try the similar code given in the solution of:

    http://social.msdn.microsoft.com/Forums/en-US/vsx/thread/7c789b17-a3e3-45b7-a01d-7bede1007a58/

    to implement ProjectFinishedGenerating method.

    Hope this can help.

    Best Regards,

    Ziwei Chen

    • Proposed as answer by Victor_Chen Monday, November 22, 2010 7:17 AM
    • Unproposed as answer by Victor_Chen Thursday, November 25, 2010 2:23 AM
    Friday, November 19, 2010 8:01 AM
  • Hi Chen,

    Sorry for the late reply, the code doesn't work for me. I could not get this RegisteredProjectType Class.

        RegisteredProjectType projectType = RegisteredProjectType.CreateRegisteredProjectType((EnvDTE80.DTE2)project.DTE, projectTypeGuid);

    Also he is implementing the C# project type guid to represent it as a C# project.

    I need to implement my own sub type like workflow, wpf, silverlight etc.. he should have implemented like this

    <ProjectTypeGuids>{projectSubtypeGuid};{LanguageGuid}</ProjectTypeGuids>

    Thanks,

    Mohi

     

     

    Monday, November 22, 2010 2:03 PM
  • Hi Mohi,

     

    Sorry for the delay.

    As Ed mentioned before, what you need to implement are subtypes but not templates.

    I noticed that you have complete the first step, a custom project type, very well.

    And the next step is to create its subtypes, all subtypes are individual packages with own project factory and nodes.

    There is a subtype sample in VS2005 SDK, you can download it for reference.

    Also I'm working on a C# subtype sample for 2010, and I will share it when I finish.

    Hope this can help.

     

    Best Regards,

    Ziwei Chen

    • Proposed as answer by Victor_Chen Thursday, November 25, 2010 3:43 AM
    • Marked as answer by Victor_Chen Friday, November 26, 2010 3:08 AM
    Thursday, November 25, 2010 3:07 AM