locked
Visual Studio 2013 Wizzard and add-ins transit RRS feed

  • Question

  • Hello everyone,

      I'm trying to transit between visual studio 2013 add-ins and 2015 version. My add-ins work well in 2013 version, but in 2015 version, add-ins was deprecated. But before asking few question, I'm going to make you the difference between the old simple style and the new automated complex style.


    Old Simple Version of 2013

    C++ DLL Project
        CoreXWizard.h
            ifndef CoreXWizard_H
                public ref class CoreXWizard : public IDTWizard
                //CPP FUNCTION...
            #endif
        FuncDec.h
            ifndef FuncDec_H
                public ref class FuncDec : public IDTExtensibility2 , public IDTCommandTarget
                //CPP FUNCTION...
            #endif
        MyForm.h
            ifndef MyForm_H
                public ref class MyForm : public Form
                //CPP FUNCTION...
            #endif
    End DLL Project

        In this version, we can see that we have a class for each function in package. The wizard class derived from IDTWizard and the command class derived from IDTComandTarget. To install it you must copy .Addins files inside Addins Folder and the .vsz inside Wizard Folder. You must also RegAsm the DLL to make it work.

    THE .VSZ FILES
        VSWizard 7.0
        Wizard=VSSuperPack.CoreXWizard
        Param=First Items
        Param=Second Items
    
    
    THE .ADDINS FILES
        <?xml version="1.0" encoding="utf-16" standalone="no"?>
        <Extensibility xmlns="http://schemas.microsoft.com/AutomationExtensibility">
            <HostApplication>
                <Name>Microsoft Visual Studio</Name>
                <Version>14.0</Version>
            </HostApplication>
            <Addin>
                <FriendlyName>Function Description</FriendlyName>
                <Description>Auto comment function</Description>
                <Assembly>VSSuperPack.dll</Assembly>
                <FullClassName>VSSuperPack.FuncDescript</FullClassName>
                <LoadBehavior>0</LoadBehavior>
                <CommandPreload>1</CommandPreload>
                <CommandLineSafe>0</CommandLineSafe>
            </Addin>
    </Extensibility>
    

       If you remark the add-ins and the wizard point to namespace.class. For IDTWizard class everything pass by Execute. For the Command class two function was important, the OnConnection and Exec. It's by the OnConnection function that you add your entry menu inside visual studio interface.


    Verdict:

    Wizard working in Visual Studio 2013 and 2105.

    Command working only in 2013, no menu entry for 2105

        You can find the example on my git hub


    Complex version of VSIX

    C++ DLL Project CPP, DEF IDL pkgdef and automated GUID End DLL Project C++ DLL Project VSCT Files and Menu Entry for UI End DLL Project VSIX Project Reference of both preview dll End VSIX Project


        On this form, we have a dll for the code and a dll for the menu enty. The vsix project was the auto-deploy result. Ok, for this moment, it's was simple. The problem is that a lot of element was linked to GUID number generated by the c# way. But I'm on c++ way and we can't add command menu or tool menu component. For the VSIX part, it's was great, because we don't need to create deploy solution.


    Question:   GIT EXAMPLE

    1. Wizard is not support in new extensibility c++ project. Does it's possible to modify VSIX manifest to deploy wizard?
    2. Does it's possible to flush vsct to pass by OnConnection mode and add entry with c++ function or modify the vsct to connect on a namespace.class like old style?
    3. If I want make a custom property for my wizard how I must process?

    Thanks!



    • Edited by Fleµve Monday, January 4, 2016 2:48 PM Grammar
    • Moved by May Wang - MSFT Tuesday, January 5, 2016 7:09 AM VSX
    Monday, January 4, 2016 5:23 AM

Answers

  • You can deploy a custom project or item template with a custom wizard via VSIX. But currently there is no support for doing the same with the older .VSZ based templates/wizards.

    An example of how to generate a custom project or item template, with a custom wizard, and deployed via VSIX can be found here:

       Creating a VSIX Deployable Project (or Item) Template with Custom Wizard Support

    Also, a .VSCT file is complied by a CTC compiler into a resource which is typically embedded in a VSPackage assembly. A VSPackage extension is also deployable via a .VSIX

    A .vsz file is nothing more than a text file, you don't run regasm on a .vsz file.

    Sincerely,


    Ed Dore

    • Marked as answer by DotNet Wang Tuesday, January 26, 2016 6:31 AM
    Wednesday, January 20, 2016 4:42 AM

All replies

  • Hi,

    Thanks for posting here.

    I will help you move this case to visual studio interage forum for a better support. Hope you can understand.

    May


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, January 5, 2016 7:12 AM
  • Hi Fleµve,

    >>Wizard is not support in new extensibility c++ project. Does it's possible to modify VSIX manifest to deploy wizard?

    Please see below article, Custom Wizard also supported in Visual Studio 2015.
    https://msdn.microsoft.com/en-us/library/bhceedxx.aspx

    >>Does it's possible to flush vsct to pass by OnConnection mode and add entry with c++ function or modify the vsct to connect on a namespace.class like old style?

    Yes, vsct file also could works on Visual Studio 2015.

    Best Regards,
    Li Wang


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, January 6, 2016 6:03 AM
  • Thanks for your support!

       I Know that custom wizard was supported, but it's HTML dialog based and Java Project Engine.

    That's mean:

    • Your dialog size was restrict to a maximum.
    • You don't have Intellisenses for java.
    • I'm more a c++ DirectX Programmer, that's mean that It's easier to me program by example a browse button in c++ rather that java.

    My Wizard is a C++ DLL form, look closer that C# form. I Convert my wizard from a C# technique. In reality it's a C++ CLR Class Library. 

    That's mean:

    • My Dialog was based on Framework Form (System::Windows::Forms) instead MFC Dialog
    • All plugins is pure c++ working with Intellisenses
    • All my personal c++ library was available

    For my first Question:

       The true question is, does VSIX can copy .vsz file inside wizard folder and does VSIX can REGASM the DLL?

    For my question Question:

       How configure the VSCT to connect directly to a namespace.class?

    OR

       If we remove VSCT file,  Does the class can dynamically place entry in the menu? 


    • Edited by Fleµve Wednesday, January 6, 2016 2:11 PM redunt
    Wednesday, January 6, 2016 2:10 PM
  • You can deploy a custom project or item template with a custom wizard via VSIX. But currently there is no support for doing the same with the older .VSZ based templates/wizards.

    An example of how to generate a custom project or item template, with a custom wizard, and deployed via VSIX can be found here:

       Creating a VSIX Deployable Project (or Item) Template with Custom Wizard Support

    Also, a .VSCT file is complied by a CTC compiler into a resource which is typically embedded in a VSPackage assembly. A VSPackage extension is also deployable via a .VSIX

    A .vsz file is nothing more than a text file, you don't run regasm on a .vsz file.

    Sincerely,


    Ed Dore

    • Marked as answer by DotNet Wang Tuesday, January 26, 2016 6:31 AM
    Wednesday, January 20, 2016 4:42 AM
  • Thanks a lot!

        It's work well! I check it last week, sorry for delay.It's take me 1 night to understand c#, another one to convert into C++ and a last one to fix Key Problem.

    • Into .VSZ version : I use regasm register the dll, but I don't StrongName the DLL with a key. That's give me warning, but working. (It's was a error start point)
    • Into VSIX version : Now SN.exe, made everything for you. You can create KeyFile, get public token (important) and resign your dll (important to put SN -Ra in post process. Between building dll and packaging dll.)

    To complete it, is use this form.

    Solution - MyTemplateWithWizard

    • MyProjectTemplate   (produces the template as a .zip file) IN C# -> C++ don't build VSTemplate in compiler
    • MyTemplateWizard   (produces an assembly with an IWizard implementation) IN C++ CLR ClassLibrary
    • MyTemplateWithWizardVSIX   (the .VSIX) IN C# -> like C++ extensibility VSPackage

    With your permission, i will retake your tutorial (by respect of author and grammar because I'm french... like copy/paste) and create a PDF version for C++ way.

    • Modify template must be rewrite to fit with export template zip file
    • Modify the .VSIX project to build a custom wizard implementation must be modify to replace c++ code and some c++ reference erratum
    • Associate the Wizard with the project template must be modify to include public key (assemblyInfo.cpp, build properties and post build command)

    Modify the template (C++ Version)

    1. Open your C++ Project that you will template
    2. File->Export Template
    3. Reopen your Wizard Project
    4. Flush all file inside C# MyProjectTemplate
    5. With file explorer decompress your zipped template inside MyProjectTemplate (you can find your template zip file inside [$(VisualStudioDir)My Exported Template]
    6. On MyProjectTemplate Project node, right-click and re-add every file that you have decompress
    7. change  .vstemplate proprieties (right-click). Action to VSTemplate.

    to be continue inside PDF....

    Thanks a lot!


    Monday, February 1, 2016 6:31 PM