Embedding of PIAs
One tooling and compiler feature we’ve ignored in the previous discussion is the so-called No PIA. As mentioned during the introduction on improved COM interop, the use of PIAs has drawbacks with regard to deployment size. Even though they don’t contain code, quite a bit of metadata lives on the contained interfaces and defined operations. All of that results in big assemblies, of which only a fraction of functionality is usually used by an application.
To alleviate the need for big deployments, .NET 4.0 added the option to embed used interop types in your own assembly. Figure 22.32 shows where this gets enabled in the Properties window for a selected PIA reference assembly.
FIGURE 22.32 Enabling the No PIA feature for a reference ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access