locked
Where to put Custom Item Templates for Windows Store Apps (XAML/C#) in VS2012 Update 3?

    Question

  • My original post was in the VS General Questions forum (Can't see My Templates (VS 2012 Update 3).

    There I was asked to post the question here, since the custom template handling for Windows Store App projects seems to be different from other project types.

    My question is: Where do I have to put the item templates (C#) so that they will be listed in the "Add new item" dialog in the "My Templates" section for Windows Store Apps (XAML/C#). "C:\Users\xxx\Documents\Visual Studio 2012\Templates\ItemTemplates\Visual C#\My Templates" does not work.

    Thanks

    Stefan

    Friday, July 5, 2013 8:33 AM

Answers

  • Rob,

    Thanks for your reply. The link to the other thread (VS2012 item template) gave me the required information.

    After adding <TemplateID>Microsoft.CSharp.Class</TemplateID> to the <TemplateData> section of the MyTemplate.vstemplate file contained in the template zip, the custom class template appeared in the "My Templates" section of the "Add New Item" Dialog in my Windows Store app project. (The file has to be located in the "C:\Users\xxx\Documents\Visual Studio 2012\Templates\ItemTemplates\Visual C#\My Templates" directory.)

    To my surprise, when adding a new class to a Windows console application, this class template is listed twice now. Removing the entry from the vstemplate file, the duplicate was gone. Unfortunately, the template wasn't listed in my Windows Store app project any more.

    So I would confirm that there is a bug. And no, I hadn't had the chance to try this with Windows 8.1 and VS 2013.

    Regards,
    Stefan


    • Edited by rstg Monday, July 8, 2013 9:54 AM changed wording
    • Marked as answer by rstg Monday, July 8, 2013 9:55 AM
    Monday, July 8, 2013 9:53 AM

All replies

  • I believe they go in the same place as any other template. There isn't anything specific to Windows Store apps for this. See How to: Create Project Templates

    There may be a bug here. See http://social.msdn.microsoft.com/Forums/windowsapps/en-US/ada1973a-f407-48fc-9385-05fee0351081/vs2012-item-template .

    Do you also reproduce this with Visual Studio 2013 on Windows 8.1?

    --Rob

    Saturday, July 6, 2013 1:03 AM
    Moderator
  • Rob,

    Thanks for your reply. The link to the other thread (VS2012 item template) gave me the required information.

    After adding <TemplateID>Microsoft.CSharp.Class</TemplateID> to the <TemplateData> section of the MyTemplate.vstemplate file contained in the template zip, the custom class template appeared in the "My Templates" section of the "Add New Item" Dialog in my Windows Store app project. (The file has to be located in the "C:\Users\xxx\Documents\Visual Studio 2012\Templates\ItemTemplates\Visual C#\My Templates" directory.)

    To my surprise, when adding a new class to a Windows console application, this class template is listed twice now. Removing the entry from the vstemplate file, the duplicate was gone. Unfortunately, the template wasn't listed in my Windows Store app project any more.

    So I would confirm that there is a bug. And no, I hadn't had the chance to try this with Windows 8.1 and VS 2013.

    Regards,
    Stefan


    • Edited by rstg Monday, July 8, 2013 9:54 AM changed wording
    • Marked as answer by rstg Monday, July 8, 2013 9:55 AM
    Monday, July 8, 2013 9:53 AM