Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove dependency upon Microsoft.VisualStudio.SDK.EmbedInteropTypes #9289

Merged
merged 2 commits into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
<PackageVersion Include="Microsoft.VisualStudio.Interop" Version="17.4.0-preview-2-32826-307" />
<PackageVersion Include="Microsoft.VisualStudio.ManagedInterfaces" Version="8.0.50728" />
<PackageVersion Include="Microsoft.VisualStudio.RpcContracts" Version="17.7.5-preview" />
<PackageVersion Include="Microsoft.VisualStudio.SDK.EmbedInteropTypes" Version="15.0.36" />
<PackageVersion Include="Microsoft.VisualStudio.Settings.15.0" Version="17.3.32804.24" />
<PackageVersion Include="Microsoft.VisualStudio.Setup.Configuration.Interop" Version="3.2.2146" />
<PackageVersion Include="Microsoft.VisualStudio.Shell.15.0" Version="17.3.32804.24" />
Expand Down
48 changes: 0 additions & 48 deletions eng/imports/HostAgnostic.props
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@

<!-- Host-Agnostic Visual Studio -->
<PackageReference Include="Microsoft.VisualStudio.ImageCatalog" />
<PackageReference Include="Microsoft.VisualStudio.SDK.EmbedInteropTypes" />
</ItemGroup>

<ItemGroup Condition="'$(IsUnitTestProject)' == 'true'">
Expand All @@ -80,51 +79,4 @@

<InternalsVisibleTo Include="DynamicProxyGenAssembly2" Key="$(MoqPublicKey)" />
</ItemGroup>

<!--
Some of the VSSDK packages may pull in Microsoft.VisualStudio.SDK.EmbedInteropTypes which essentially
does the below but for all of the listed references. We can't just use what they have since they include
things like EnvDTE which is reasonable for consumers, but strange since we actually _implement_ DTE and
use it as an exchange type with generics in a few places. Instead, we run directly after the target declared
in the EmbedInteropTypes package and ensure only the dependencies we need are embedded and the others are
skipped.
-->
<Target Name="CustomLinkVSSDKEmbeddableAssemblies" AfterTargets="LinkVSSDKEmbeddableAssemblies">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we sure this is no longer needed? While we may no longer need Microsoft.VisualStudio.SDK.EmbedInteropTypes, I would expect we still need to be careful about what we do or do not embed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be a simple matter to search for each of these target names in the codebase (or a binlog file) to see if anyone references them.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose the definitive answer would be to build with and without this change and see if there are changes in what gets embedded.

Though if the guidance for 64-bit VS is to not embed interop types and that is the default behavior then we're probably best off removing all of this non-default embedded behavior and just dealing with the fallout (if any).

<ItemGroup>
<ReferencePath Condition="
'%(FileName)' == 'Microsoft.VisualStudio.Setup.Configuration.Interop'
or '%(FileName)' == 'Microsoft.VisualStudio.Shell.Embeddable'
or '%(FileName)' == 'Microsoft.VisualStudio.Shell.Interop.12.0'
or '%(FileName)' == 'Microsoft.VisualStudio.Shell.Interop.12.1.DesignTime'
or '%(FileName)' == 'Microsoft.VisualStudio.Shell.Interop.14.0.DesignTime'
or '%(FileName)' == 'Microsoft.VisualStudio.Shell.Interop.15.0.DesignTime'
or '%(FileName)' == 'Microsoft.VisualStudio.Shell.Interop.15.3.DesignTime'
or '%(FileName)' == 'Microsoft.VisualStudio.Shell.Interop.15.7.DesignTime'
or '%(FileName)' == 'Microsoft.VisualStudio.Shell.Interop.15.8.DesignTime'
or '%(FileName)' == 'Microsoft.VisualStudio.TextManager.Interop.12.1.DesignTime'
or '%(FileName)' == 'Microsoft.VisualStudio.ProjectSystem.Interop'
or '%(FileName)' == 'stdole'
or '%(FileName)' == 'Microsoft.VisualStudio.CommandBars'
or '%(FileName)' == 'NuGet.VisualStudio'
or '%(FileName)' == 'VSLangProj110'
or '%(FileName)' == 'VSLangProj165'
">
<EmbedInteropTypes>true</EmbedInteropTypes>
</ReferencePath>
<ReferencePath Condition="
'%(FileName)' == 'Microsoft.VisualStudio.Imaging.Interop.15.0.DesignTime'
or '%(FileName)' == 'Microsoft.VisualStudio.Shell.Interop.10.0'
or '%(FileName)' == 'Microsoft.VisualStudio.Shell.Interop.11.0'
or '%(FileName)' == 'Microsoft.VisualStudio.Feedback.Interop.12.0.DesignTime'
or '%(FileName)' == 'microsoft.visualstudio.designer.interfaces'
or '%(FileName)' == 'EnvDTE80'
or '%(FileName)' == 'EnvDTE90'
or '%(FileName)' == 'EnvDTE100'
or '%(Filename)' == 'Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime'
or '%(FileName)' == 'Microsoft.Internal.VisualStudio.Shell.Interop.14.1.DesignTime'
or '%(FileName)' == 'Microsoft.Internal.VisualStudio.Shell.Interop.14.2.DesignTime'">
<EmbedInteropTypes>false</EmbedInteropTypes>
</ReferencePath>
</ItemGroup>
</Target>
</Project>