共用方式為


Troubleshooting template installation

Applies to: yesVisual Studio noVisual Studio for Mac

Note

This article applies to Visual Studio 2017. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

If you run into problems deploying your project or item templates, you can enable diagnostic logging.

  1. Create a pkgdef file in the Common7\IDE\CommonExtensions folder for your installation. For example, C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\EnablePkgDefLogging.pkgdef.
  1. Add the following to the pkgdef file:

    [$RootKey$\VsTemplate]
    "EnableTemplateDiscoveryLog"=dword:00000001
    
  2. Open a Developer Command Prompt for your installation and run devenv /updateConfiguration.

  1. Open Visual Studio and launch the New Project and New Item dialog boxes to initialize both template trees.

    The template log now appears in %LOCALAPPDATA%\Microsoft\VisualStudio\15.0_[instanceid]\VsTemplateDiagnosticsList.csv (instanceid corresponds to the installation ID of your instance of Visual Studio). Each template tree initialization appends entries to this log.

The log file contains the following columns:

  • FullPathToTemplate, which has the following values:

    • 1 for manifest-based deployment

    • 0 for disk-based deployment

  • TemplateFileName

  • Other template properties

Note

To disable logging, either remove the pkgdef file, or change the value of EnableTemplateDiscoveryLog to dword:00000000, and then run devenv /updateConfiguration again.

See also