且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

PIA不会安装在我的开发机器上

更新时间:2023-11-19 20:50:04

嗨布拉德

嗯。 Microsoft已经支持并行安装多个Office版本超过十年。它可以在最终用户级别工作,但问题可能会突然出现。在编写VSTO解决方案时,它根本不起作用,因为VSTO拒绝
正常运行(按设计)。其中一个主要原因是,无论GAC中可能存在多少个版本,Windows注册表中都只会引用一个版本的PIA。

Mmm. Parallel installation of multiple Office versions hasn't been supported by Microsoft for over ten years. It can work at the end-user level, but problems can crop up. When it comes to programming VSTO solutions it simply will not work as VSTO refuses to function properly (by design). One of the main reasons for this is that only one version of the PIAs will be referenced in the Windows Registry, no matter how many versions may be present in the GAC.

添加到此只有在计算机上存在相关Office版本时,才会安装PIA安装程序。实际上,甚至还有一个问题是PIA是否应该作为一个单独的分发包提供,因为如果出现任何版本的.NET Runtime(GAC),Office的最新版本
应该自动安装它们。机器。对于最近发布的Windows版本就是这种情况。

Add to this that the PIA installer will only install if the version of Office in question is present on the machine. Actually, there was even a question whether the PIAs should be made available as a separate distribution pack because the most recent versions of Office should be installing them automatically if any version of the .NET Runtime (the GAC) is present on the machine. And this will be the case with most recent releases of Windows.

最后,您不能将PIA版本与不同版本的Office一起使用(2007年PIA与Office 2010一起使用) , 例如)。版本必须匹配。

And lastly, you can't use a version of the PIAs together with a different version of Office (2007 PIAs with Office 2010, for example). The versions have to match.

您的系统是否可以"轻松"清理不确定。注册表可能已被"破坏",但您可以尝试。我的第一个建议是卸载所有PIA可再发行组件和计算机上安装的所有Office版本。
然后重新安装您想要用于开发的Office版本。

Whether your system can be cleaned up "easily" is uncertain. It's possible that the Registry has been "broken", but you can try. My first recommendation would that you uninstall all the PIA redistributables AND all versions of Office installed on the machine. Then reinstall just the version of Office you want to use for developing.

如果需要针对各种版本的Office进行开发,则需要多台开发机器:每台一台Windows / Office组合。许多开发人员使用虚拟机软件,例如VMWare(我的偏好)或VPC。

If you need to develop against various versions of Office you'll need multiple development machines: one for each Windows/Office combination. Many developers use virtual machine software, such as VMWare (my preference) or VPC.

如果您使用的是Visual Studio 2010并且可以定位.NET Framework 4.0,则可以开发与版本无关的版本解决方案。 4.0允许您将Office类型库信息嵌入到可分发的解决方案中,而不是直接在
运行时引用PIA。

If you're using Visual Studio 2010 and can target .NET Framework 4.0 it's possible to develop version-independent solutions. 4.0 allows you to embed the Office type library info into the solution distributable, rather than referencing the PIAs directly at run-time.