question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How does the VS wizard work?

See original GitHub issue

I’ve been trying to use the TemplateEngine Wizard to embed a dotnet templating template in a VSIX package. I know SideWaffle v2 does exactly that, but I want to understand how the wizard works instead of relying on a third-party tool. So far I have failed to get a template working without SideWaffle in VS2019. Here’s what I got from @sayedihashimi’s explanations:

  • The nupkg that contains the template needs to be in the vsix.
  • a pkgdef needs to be included with the following content to make the template discoverable for the wizard:
[$RootKey$\TemplateEngine\Templates\<something-unique>]
"InstalledPath"="$PackageFolder$"    // Path to the folder with the nupkg
  • A .zip file with the template.json and .vstemplate needs to be in the vsix
  • Set the following CustomParameters in the vstemplate file
    • $groupid$ to the group id specified in the template.json file
    • $language$ to the language as specified in the template.json under tags.language (or is this appended to groupid to get the identity?)
    • $uistyle$ to ‘none’
  • Reference the wizard in the vstemplate file:
<WizardExtension>
  <Assembly>Microsoft.VisualStudio.TemplateEngine.Wizard, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</Assembly>
  <FullClassName>Microsoft.VisualStudio.TemplateEngine.Wizard.TemplateEngineWizard</FullClassName>
</WizardExtension>
  • In the vsix manifest, include the template folder as a ProjectTemplate asset and the pkgdef as a vspackage asset:
<Assets>
    <Asset Type="Microsoft.VisualStudio.VsPackage" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%;PkgdefProjectOutputGroup|" />
    <Asset Type="Microsoft.VisualStudio.ProjectTemplate" Path="<path to folder that contains zip file (zip file can be in subfolder of this for VS nodes)>" />
</Assets>

Having taken all these steps, VS fails to create a project from the template when testing the VSIX. I shows an error dialog with the following message:

To create this project type, go to Tools | Options | Projects and
Solutions | .NET Core and check "Use preview versions of the
.NET Core SDK"

Which seems to indicate that maybe it can’t find the dotnet executable (even thought it’s in my PATH). I’m wondering if I’m missing anything or if anyone has a clue what’s wrong. VSIX built with SideWaffle v2 work just fine.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Jjaggcommented, Aug 4, 2019

@phenning Sorry for the bump. How should the templating engine find and copy over the nupkg? It’s not getting copied over to the .templateengine folder.

0reactions
Jjaggcommented, Mar 20, 2020

@donJoseLuis Well I looked into this again to upload the project and gave it another go from scratch in the process and… It works! I don’t have a clue what I did wrong before or what I did differently this time, but I have it working right now 😃 I’ll reopen or open a new issue if I figure out what happened and it turns out to be a bug, but for now I’ll assume I did something wrong.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Sorcerers or Wizards - Baldur's Gate 3 - GameFAQs
Depends on what you want to achieve: Sorcerers have access to less arcane spells overall, but in return they gain Metamagic, allowing them...
Read more >
dnd 5e - What is the broad overview of the differences ...
Wizards use Intelligence as a spellcasting modifier, while sorcerers use Charisma. These abilities are associated with different skills, so that ...
Read more >
wizard and sorcerer, whats the difference : r/BaldursGate3
Lore wise, a Wizard gets their power from learning and study which causes their magic to be based on the intelligence stat.
Read more >
Sorcerer vs Wizard? Whats the key differences?
They learn two free spells of any level they can cast at each level, and they can learn more by copying them into...
Read more >
Wizard (card game)
The objective of the game is to bid correctly on the number of tricks that a player will take in the subsequent round...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found