Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I was also wondering how I should do this. I saw the following example: <a href="https://stackoverflow.com/questions/12350028/insert-a-new-guid-to-visual-studio-2012">Inserting a Guid for VS 2012</a>. For VS2013 you have to install the <a href="http://go.microsoft.com/?linkid=9832352" rel="nofollow noreferrer">SDK</a>. Once you have done that you will see the template project items for packages and also for addins when you go to add a new project.</p> <p>Despite the documentation saying that addins were deprecated in VS2013 they do appear to work (I am using VS2013 Ulitmate v 12.0.21005.1 REL). You can follow the instructions in the previous article.</p> <p>I also created a package which was relatively straight forward too. Using How to: <a href="http://msdn.microsoft.com/en-us/library/vstudio/dn246938.aspx" rel="nofollow noreferrer">Convert an Addin to a VS Package</a> I was able to create the package. </p> <p>As in the article I added the following using statements:</p> <pre><code>using EnvDTE; using EnvDTE80; </code></pre> <p>I then changed the MenuItemCallback method to the following:</p> <pre><code>private void MenuItemCallback(object sender, EventArgs e) { DTE2 dte = (DTE2)GetService(typeof(DTE)); if (dte.ActiveDocument != null) { TextSelection objSel = (EnvDTE.TextSelection)(dte.ActiveDocument.Selection); objSel.Insert(Guid.NewGuid().ToString()); } } </code></pre> <p>After building the project I went to the bin\Debug folder and started the vsix file (GuidPackage.vsix in my case). This installed the package for use in the IDE.</p> <p>I now have a menu item to insert guids into my code and am able to create a shortcut key stroke for it in the usual way.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload