问题描述
我已经按照非常有用的文章编写您的第一个Visual Studio语言服务.我的语法运作良好,启动并运行了一些简单的goto案例,并为文本着色.我已经在Irony GrammarExplorer和Visual Studio Experiment Hive中进行了测试,我觉得我已经准备好在Visual Studio中正常使用它,并将其部署到其他一些程序员中进行早期测试和反馈. >
问题是我不知道如何安装语言服务.我有一个可以在Experimenting Hive中工作的小巧的DLL,但是不知道每当我启动Visual Studio时如何运行它.我看了遍整个互联网,发现在我所看到的所有地方都掩盖了特定的步骤.也许我只是盲目的,或者比我想象的要容易得多,但是如果有人可以给我有关如何安装语言服务的详细步骤,我将不胜感激.
提前谢谢!
在这里放置了风滚草徽章后,我设法找到了解决方案.人们可能会发现有用的几个重要方面.
首先需要一个PLK(程序包加载密钥).它可以在这里生成: http://msdn.microsoft.com/zh-CN/vstudio/cc655795.aspx 确保输入的所有信息正确无误,并且已输入dll的程序集.
通过将解决方案的rsx文件(通常作为项104)添加到解决方案的rsx文件中,然后在代码中的ProvideLoadKey属性中匹配该项号来安装PLK.
接下来测试PLK有点麻烦.提示可以在这里找到: http://msdn .microsoft.com/en-us/library/bb164677%28v = VS.90%29.aspx 我强烈建议您从一开始就首先将/noVSIP开关与实验性配置单元一起使用.我发现使用/log并没有真正的帮助,安装包并仍然遇到PLK问题后,最好使用Package Load Analyzer.
可以使用以下命令行对软件包负载分析器进行更详细的描述:devenv/command tools.analyzepackage/analyzeargs {您的GUID} analyticspkg.txt
一旦您满意并准备好进行部署,那么MSDN上的教程似乎比应该埋葬的要深得多. http://msdn.microsoft.com/en-us/library/bb458038%28VS.90%29.aspx
我发现对VS SDK bin目录中的RegPkg工具感到好奇的是,这会使我的程序包在其存在的开发解决方案中很好地加载,但不会在其他解决方案中加载.我似乎缺少一个额外的步骤来调用devenv/setup,而在上一节中我通过使用自定义操作提供了部署教程,该步骤已解决了这一问题.
无论如何,我希望这可以帮助某人执行与我相同的过程.
I've written a new Visual Studio language service for my software studio's internal scripting language following the directions from a very useful article Writing Your First Visual Studio Language Service. I've got my grammar working great, some simple goto cases up and running, and text coloring. I've done my testing both in the Irony GrammarExplorer and the Visual Studio Experimental Hive, and I feel I'm ready to use it normally in visual studio and deploy it out to a few other programmers for some early testing and feedback.
The problem is I don't know how to install the language service. I have this nice little DLL that works in the Experimental Hive, but no clue how to have it running whenever I start up visual studio. I've looked all over the internet and found that particular step is glossed over everywhere I look. Maybe I'm just blind, or it's much easier than I think it to be, but I'd really appreciate it if someone could give me detailed steps on how to install my language service.
Thanks in advance!
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.aspxBe 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.
这篇关于安装自定义Visual Studio语言服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!