我想检查当前安装的VSPackage的版本,以便在其版本过期时通知用户。我还不想上传我的扩展,所以我不能使用内置的更新功能。
我怎样才能读取我的扩展名的版本,这个版本是在vsixmanifest文件中指定的?
发布于 2014-07-14 21:06:28
您可以使用如下函数:
public static Version GetExecutingAssemblyVersion()
{
var ver = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location);
// read what's defined in [assembly: AssemblyFileVersion("1.2.3.4")]
return new Version(ver.ProductMajorPart, ver.ProductMinorPart, ver.ProductBuildPart, ver.ProductPrivatePart);
}
https://stackoverflow.com/questions/24724871
复制相似问题