从代码中检测电流VSIX软件包的版本 [英] Detect current VSIX package's version from code

查看:148
本文介绍了从代码中检测电流VSIX软件包的版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写一个VSIX项目,我想为代码能够确定更新是否可用。

I am writing a VSIX project and I would like for the code to be able to determine whether an update is available.

我知道的Visual Studio将能够检查更新,但是,我想为扩展到能够提示用户(开发者)更加冗长。

I know Visual Studio would be able to check for the update, however, I would like for the extension to be able to prompt user (developer) more verbosely.


  1. 我不知道可以使延长从包装清单读出自己的版本?

感谢您。

推荐答案

我发现我可以直接从清单XML文件中读取的版本信息。

I found that I could read the version information directly from the manifest XML file.

        var doc = new XmlDocument();
        doc.Load(manifestPath);
        var metaData = doc.DocumentElement.ChildNodes.Cast<XmlElement>().First(x => x.Name == "Metadata");
        var version = identity.GetAttribute("Version");



我也写了的要点C#类代码封装上面的代码。此外,版本,这种技术可以用来获得通过清单文件提供的其他信息。

I also wrote a gist C# class code that encapsulate the code above. Besides, version, this technique could be used to get other information provided by the manifest file.

这篇关于从代码中检测电流VSIX软件包的版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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