Pergunta

Background:

I am working on a SDK that allows its users to create custom plugins for an existing product. There is a bit of boilerplate code/file copy/COM DLL registration required for the plugin integration.To ease things for the plugin developer, I have written a Visual Studio custom project template that uses a IWizard to create a new solution, add couple of projects, generate a number of files containing the boilerplate code as well as some batch files that get executed as a post build event.

The wizard has a number of fields (such as the copyright header that needs to be inserted at the top of each generated file) that the user can edit to customize the generated code.

The Question

I'd like to persist some of the customizations and use it across multiple runs of the wizard. I also know the usual recommended places for individual applications to store their settings is under %APPDATA%. I'd like to know if there are any other places where specifically Visual Studio extensions can store their settings or I should just treat this as an standalone application and go with the %APPDATA% folder. The reason I ask is further down the line, I like to allow the plugin developers to share these settings via VS->Tools->Import & Export Settings

Foi útil?

Solução

You have two options. You can use Visual Studio's DialogPage which will show up your configurations in Visual Studio's Options window. You can also use IProfileManager, if you do not want your preferences to show in Options window but you still want to persist them.

I have written blog post about both of these options. These posts contains complete details and code snippets.

  1. Integration with Visual Studio Options Window using custom controls
  2. Persisting settings without using Options dialog in Visual Studio
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top