Visual Studio Developer Center >
Visual Studio Forums
>
Visual Studio Extensibility
>
SampleDocViewEditor sample: registering an extension other than .addin has issues
SampleDocViewEditor sample: registering an extension other than .addin has issues
- Hi. I am working on a project based on SampleDocViewEditor sample. I found out that if I change the test extension, used in the sample, to something else (say, .testaddin), it would not receive "View Code | View Designer" options in following situation:
1. Create a new project
2. Add ".testaddin" file to the project
3. Exclude it from the project
4. Close the solution and remove ".suo" file (apparently it keeps some info there), or create a new solution
5. Select "Show All Files" and include it back.
Now, the file will be in project, but without "View Code | View Designer" options (no SubType Designer element in csproj).
Simpliest way to change the extension is to take SampleDocViewEditor sample, run Replace on entire solution, replace all entries of "addin" with "testaddin" and then rename "Templates/Sample.addin".
Sample documentation says: "The XML EditorFactory takes care of setting the VSHPROPID_SubItemType property for us. We just need to register that we are a designer view for a particular type of XML file with the XML Editor." Exploring that, I found out that ".addin" type is an existing type registered under Xml Editor in these keys:
[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0Exp\Configuration\ Editors\{FA3CD31E-987B-443A-9B81-186104E8DAC1}\Extensions]
[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0Exp\Configuration\ Editors\{412B8852-4F21-413B-9B47-0C9751D3EBFB}\Extensions]
This registration is there after regular VS install and is not affected by this sample. If it is removed, the issue starts to happen for .addin files too. Rebuilding the sample in its original state does not restores these keys.
So, my question is, is this issue missed in the sample, or do I miss something here?- Edited byNikita Frolov Friday, June 27, 2008 9:07 AMerrors in text
Answers
- This issue has been encountered before: http://forums.msdn.microsoft.com/en-US/vsx/thread/7b42b539-2736-4798-a06d-ca2ae3246665
Sounds like it is an issue with the sample, You may also submit it to the following site in the formal way: http://connect.microsoft.com/VisualStudio/After you submit it, we will appreciate it if you can share the feedback address so that it can be found and checked out by other community members having similar issues.
Thanks for your valuable feedback!
Please remember to mark the replies as answers if they help and unmark them if they provide no help.- Proposed As Answer byFeng ChenModeratorTuesday, July 01, 2008 4:12 AM
- Marked As Answer byFeng ChenModeratorThursday, July 03, 2008 4:45 AM
All Replies
- This issue has been encountered before: http://forums.msdn.microsoft.com/en-US/vsx/thread/7b42b539-2736-4798-a06d-ca2ae3246665
Sounds like it is an issue with the sample, You may also submit it to the following site in the formal way: http://connect.microsoft.com/VisualStudio/After you submit it, we will appreciate it if you can share the feedback address so that it can be found and checked out by other community members having similar issues.
Thanks for your valuable feedback!
Please remember to mark the replies as answers if they help and unmark them if they provide no help.- Proposed As Answer byFeng ChenModeratorTuesday, July 01, 2008 4:12 AM
- Marked As Answer byFeng ChenModeratorThursday, July 03, 2008 4:45 AM
- To get this to work, I had to add the extension to the keys you mentioned, and I had to add it to the language extensions. Here are the attributes to do that:
[
ProvideEditorExtension("{412B8852-4F21-413B-9B47-0C9751D3EBFB}", ".testaddin", 32)][
ProvideEditorExtension("{FA3CD31E-987B-443A-9B81-186104E8DAC1}", ".testaddin", 32)][
ProvideLanguageExtension("{f6819a78-a205-47b5-be1c-675b3c7f0b8e}", ".testaddin")]

