Why is my Visual Studio 2010 custom tool not being

2019-09-07 07:32发布

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条回答
混吃等死
2楼-- · 2019-09-07 08:22

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.

查看更多
登录 后发表回答