将古老的VS扩展升级到2019年 [英] Upgrade an ancient VS extension to 2019

查看:563
本文介绍了将古老的VS扩展升级到2019年的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我曾经为Visual Studio编写过扩展程序。好吧,复制和黑客一起。我从来都不太明白这是怎么回事。但它非常有用,我不想错过它。我也希望再次在VS画廊中看到它,所以它需要升级到
最新标准。该扩展正式支持VS 2010至2015年,从那时起一切都发生了变化。清单文件格式是全新的,似乎不再知道任何包,引用和类。

I've once written an extension for Visual Studio. Well, copied and hacked it together. I never quite understood how that works. But it's very useful and I don't want to miss it. I also want to see it in the VS gallery again so it needs to be upgraded to the latest standards. The extension officially supports VS 2010 to 2015, since then everything has changed. The manifest file format is completely new, and it seems like none of the packages, references and classes are known anymore.

扩展在VS 2017中工作正常,我确定它如果我只增加版本号,它仍然可以在VS 2019中工作。但VS画廊甚至不允许我上传它。因此,在VS 2017中安装它已经是一个手动过程,警告显示
up。

The extension does work fine in VS 2017, and I'm sure it would still work in VS 2019 if I just incremented the version number. But the VS gallery won't even let me upload it. So installing it in VS 2017 is already a manual process with a warning showing up.

这是包含源代码链接的页面:
https://marketplace.visualstudio.com/items?itemName=ygoe.TODOHighlighter

Here's the page with a link to the source code: https://marketplace.visualstudio.com/items?itemName=ygoe.TODOHighlighter

有人可以给我指导我需要用今天的工具重写这个吗?我打开了VS 2019并创建了一个新的VS扩展项目。它看起来与我的旧项目完全不同。无可比拟。并且复制旧文件(只需
两个短源文件)会给我错误的类型错误。所以这并不能引导我到任何地方。我也不知道如何使用新生成的文件,TodoHighlighterPackage.cs。它包含我不理解的长注释。

Can somebody please give me guidance what I need to do to rewrite this with today's tools? I've opened VS 2019 and created a new VS extension project. It looks completely different to my old project. Nothing to compare. And copying in the old files (just two short source files) gives me errors of missing types. So that's doesn't lead me anywhere. I also don't know what to use the new generated file for, TodoHighlighterPackage.cs. It contains long comments I don't understand.

推荐答案

您的扩展是MEF组件,因此您无需更改代码。但是你使用的是VS 2017 +中不支持的.vsixmanifest v1.0。

Your extension is a MEF component, so you don't need to change code. But you are using .vsixmanifest v1.0 that is not supported in VS 2017+.

最简单的升级路径应该是将.vsixmanifest改为v3.0并在VS 2017中编译扩展或者说是VS 2019.(请注意,它将放弃对在VS 2010中安装的支持。)

The simplest path to upgrade should be changing .vsixmanifest to v3.0 and compiling the extension in VS 2017 or VS 2019. (Note that it will drop support for installing in VS 2010.)

参见
是时候改变你的VSIX清单了有关更多详细信息,请参阅v3 for Visual Studio 2017兼容性


这篇关于将古老的VS扩展升级到2019年的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆