Why is my Visual Studio 2010 custom tool not being found?

无人久伴 提交于 2019-12-12 02:15:04

问题


My custom tool is as follows:

Class: FooBar.Blah.Tools.DataContextClassGenerator
Assembly: FooBar.Blah.Tools.DataContextClassGenerator
Project: FooBar.Blah.Tools.DataContextClassGenerator

The CreatePkgDef task enabled from within the project file by setting GeneratePkgDef to true creates the following pkgdef file in the build outputs.

[$RootKey$\Generators\{FAE04EC1-301F-11D3-BF4B-00C04F79EFBC}\DataContextClassGenerator]
@="Foo Bar DataContext Class Generator"
"CLSID"="{2155fcee-7012-400b-a6b3-5d8d0e34de6c}"
"GeneratesDesignTimeSource"=dword:00000001
"GeneratesSharedDesignTimeSource"=dword:00000000
[$RootKey$\Generators\{164B10B9-B200-11D0-8C61-00A0C91E29D5}\DataContextClassGenerator]
@="Foo Bar DataContext Class Generator"
"CLSID"="{2155fcee-7012-400b-a6b3-5d8d0e34de6c}"
"GeneratesDesignTimeSource"=dword:00000001
"GeneratesSharedDesignTimeSource"=dword:00000000
[$RootKey$\CLSID\{2155fcee-7012-400b-a6b3-5d8d0e34de6c}]
@="FooBar.Blah.Tools.DataContextClassGenerator"
"InprocServer32"="$WinDir$\SYSTEM32\MSCOREE.DLL"
"Class"="FooBar.Blah.Tools.DataContextClassGenerator"
"CodeBase"="$PackageFolder$\FooBar.Blah.Tools.DataContextClassGenerator.dll"
"ThreadingModel"="Both"

When I install the VSIX extension, I see the appropriate keys under the 10.0_Config key. Yet, when I set DataContextClassGenerator as the custom tool, VS2010 complains about not finding the tool.

I have tried to enable the ActivityLog for VS2010 and reviewed it, the tool is found and loaded when VS2010 starts up, yet, it is as if it's not even there.

I am at my wit's end and will appreciate any help.

I have set the VSIX to be available for install to Ultimate, Premium and Professional editions of VS2010. During install, it says it's found the Ultimate edition and says it has installed it, even though I have VS2010 Premier edition on my machine.


回答1:


The issue was that while my custom tool class itself was set to ComVisible(true), the base classes were not and therefore Visual Studio was not loading it correctly because you can't do that. The entire heirarchy of classes has to be ComVisible(true), apparently.



来源:https://stackoverflow.com/questions/10098681/why-is-my-visual-studio-2010-custom-tool-not-being-found

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!