Installing a Custom Visual Studio Language Service

徘徊边缘 提交于 2019-12-03 10:00:39

After getting the Tumbleweed badge on here I managed to track down the solution. There were a couple important bits people might find useful.

First off a PLK (Package Load Key) is needed. It can be generated here: http://msdn.microsoft.com/en-us/vstudio/cc655795.aspx Be sure to make sure that all the information you enter is correct, and is entered into the Assembly for the dll.

The PLK is installed by adding to the rsx file for the solution, usually as item 104, and then matching that item number in the ProvideLoadKey attribute in your code.

Next testing the PLK is a bit of a hassle. Tips can be found here: http://msdn.microsoft.com/en-us/library/bb164677%28v=VS.90%29.aspx I highly recommend first using the /noVSIP switch with the experimental hive right from the start. I found using /log doesn't really help, it's much better to use the Package Load Analyzer once you've installed your package and are still having PLK issues.

A more detailed description from the package load analyzer can be done with this command line: devenv /command tools.analyzepackage /analyzeargs {your GUID} analyzepkg.txt

Once you're satisfied and ready to deploy, there is a tutorial that seemed more buried than it should be over at MSDN http://msdn.microsoft.com/en-us/library/bb458038%28VS.90%29.aspx

One thing that I found was curious with the RegPkg tool found in the VS SDK bin directory was that it would cause my package to load fine in the development solution it existed in, but would not not load in other solutions. There appears to be an extra step to call devenv /setup which I was missing, and this is taken care of in the deploy tutorial I provided in the previous paragraph through the use of a Custom Action.

Anyway I hope this helps someone running through the same process as me.

One other thing that I spent a couple of hours bumping into that the MSDN tutorial doesn't mention: If you're deploying to a 64-bit computer, the instructions as given won't work. After quite a bit of searching, I stumbled across a posting halfway down this forum thread that explains it: http://social.msdn.microsoft.com/Forums/en/vsx/thread/989c5bea-3dd0-4e60-891a-f8f006e1b9a2

The MSDN tutorial says to install your registry keys here and regpkg.exe generates registry keys here as well:

HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\...

But on 64-bit computers, Visual Studio loads its settings not from there but from here:

HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\VisualStudio\9.0\...

Notice that extra "Wow6432Node" in there; the registry keys are otherwise identical but for that extra "Wow6432Node" in the path. So on 64-bit machines, you'll either need to use those extended registry keys, or you can install a hybrid 32/64-bit .dll to both sets of registry keys without ill effect. I have a .reg file that installs to both sets of keys, and it works very nicely.

Hope this helps save somebody else some time!

(For what it's worth, I used the "Codebase" mode for regpkg, not the "Assembly" mode.)

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