VSTO 次期バージョンの PIA 依存からの脱却について (Visual Studio 2010)

今日は次期 VSTO (Visual Studio 2010 リリースは多分、2009年中でしょうか。)について少し記述したいと思います。

本当は CTP 版を検証していろいろ公開したいのですが、時間的に難しいので、

取り急ぎ、情報を共有させていただきます。

この情報は社内のイケてるエンジニアさんから聞いたのですが、

というか完全にリーチしておらず、反省ひとしきりです。<(_ _)>(情報提供ありがとうございました。)

VSTO の次期バージョンでは PIA を利用せずに Office ソリューションを利用できるようです。

.NET Framework 4.0 の新機能 (Dynamic Language Runtime) を利用したレイトバインドです。

従来はアーリーバインドによるライブラリの読み込みが必要でまた、PIA は Office のバージョン依存になっていました。

これらの Office による .NET アプリケーション実行時の PIA の課題が解決できるようです。

以下は「Visual Studio 2010 and .NET Framework 4.0 Training Kit」内の VSTO 部分の抜粋です。

Office programmability relies on types from the Office Primary Interop Assembly (PIA) to be able to interface with the various applications in the office suite. In the past, this has dramatically impacted deployment of customized Office applications for a number of reasons. First, different versions of Office use different versions of the PIA, creating complexity for managing the assemblies. Secondly, IT personnel had to figure out deployment strategies to ensure required PIA resources were available across their support base. Additionally, deploying the PIA with an application resulted in a larger installation than necessary due to the extra, unused features.

要約すると、

「従来の Office PIA はバージョン間の互換性がなく、複数バージョンのOfficeを利用する場合のアセンブリの管理は非常に複雑である。また、使用しない機能などのために必要以上にリソースを利用する。」

Development in Visual Studio 2010 eases these burdens by removing this PIA dependence from applications built using Office. When the dependency is removed, the compiler will import whatever types that are needed by your application from the PIA directly into your new Office application; you simply deploy your application knowing that all the PIA classes you need are included with your application’s assemblies.

In this exercise you will learn how to remove the PIA dependency from your Office application.

「VSTO 2010 では PIA 依存を取り除くことが可能でアプリケーション実行時に直接、必要なコンポーネントを呼び込むことが可能。」

つまり、アプリケーションごとに実行時に PIA から必要なコンポーネントを呼び出すことができるので、バージョン間の依存などがなくなり、また、リソースの有効活用が可能ということだと思います。

ちょっと検証してみないと分からない部分が多く、また、上述も認識違いがあるかもしれませんが、PIA 依存を回避でき、アーリーバインドからレイトバインドになることは間違いないと思います。

これらを検証するためのリソースは以下です。

トレーニングキットには VS2010 用のサンプルやラボの他に VS2010 の概要などの資料もあります。

Visual Studio 2010 and .NET Framework 4.0 Training Kit - November Preview

https://www.microsoft.com/downloads/thankyou.aspx?familyId=752cb725-969b-4732-a383-ed5740f02e93&displayLang=en

Visual Studio 2010 CTP

https://www.microsoft.com/downloads/details.aspx?FamilyId=922B4655-93D0-4476-BDA4-94CF5F8D4814&displaylang=en

この情報を聞いたときにこれからも Office 開発はマイクロソフトの開発プラットフォームの一つとして、進化していくのだなということを感じました。

そして、最新のテクノロジを理解し、顧客ニーズに直結するデモを作成するための技術検証をおこなう。

そして、来るべきベータやリリース時点で顧客やパートナー様に提案する。

技術と顧客ニーズ、そして、それに基づく提案。これらの歯車がかみ合うことが、One Microsoft としてのあるべく姿なのかと思います。

そして、これがマイクロソフトで務める僕らの仕事だと思います。

このような思いを抱かせてくれる人が MS にいることに本当に感謝します。<(_ _)>