HowTo: Configure .prompt Files for Markdown Preview in Visual Studio
This guide explains how to configure Visual Studio to render .prompt files with the markdown preview button.
Quick Setup
The repository is already configured with the necessary files:
.editorconfig- Associates.promptfiles with markdown-like settings.vs/fileextensions.json- Maps.promptextension to markdown content type
Manual Configuration (If Needed)
If the automatic configuration doesn’t work, follow these steps:
Method 1: Using Visual Studio Settings
- Open Visual Studio
- Go to Tools → Options
- Navigate to Text Editor → File Extension
- In the Extension box, type:
prompt - In the Editor dropdown, select: Markdown Editor
- Click Add, then OK
Method 2: Using Extension Mappings
Add the following to your Visual Studio settings:
{
"fileExtensionToContentTypeDefinitions": [
{
"fileExtension": ".prompt",
"contentType": "markdown"
}
]
}Method 3: Registry Configuration (Advanced)
For system-wide configuration, you can add a registry entry:
Path: HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\<version>\Text Editor\FileExtension\Extensions
Key: prompt Value: Markdown Editor
Verifying Configuration
- Open any
.promptfile in the solution (e.g.,.github/copilot/prompts/Issue-Generate analysis from current conversation.prompt) - Look for the Preview button in the Visual Studio toolbar
- Click it to view the markdown-rendered version
Troubleshooting
Syntax Highlighting Not Working
- Go to Tools → Options → Text Editor → All Languages
- Verify that syntax highlighting is enabled
- Reset Visual Studio settings if needed
Extension Association Not Persisting
- Check if
.vsfolder is in.gitignore - Verify file permissions for
.vs/fileextensions.json - Use Method 1 (Visual Studio Settings) as an alternative
Additional Resources
Notes
- The
.vsfolder is typically excluded from version control - Configuration may need to be reapplied on different machines
- Consider documenting this setup in your team’s onboarding guide