arcade icon indicating copy to clipboard operation
arcade copied to clipboard

VSIX is only generated using .NET Framework MSBuild, not Core

Open jjonescz opened this issue 10 months ago • 1 comments

  • [ ] This issue is blocking
  • [ ] This issue is causing unreasonable pain

Running dotnet build doesn't produce a VSIX, only the full framework msbuild.exe does. That's because Core MSBuild is disabled here:

https://github.com/dotnet/arcade/blob/00bb044268c007ed27c5ab50c5839fcf36fdff0f/src/Microsoft.DotNet.Arcade.Sdk/tools/Imports.targets#L18

I'm not sure what's the reason for that because having something like the following in the project file makes dotnet build produce vsix as well:

<Project>

  <Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />

  <PropertyGroup>
    <VsixVersion Condition="'$(VsixVersion)' == ''">42.42.42.4242424</VsixVersion>
    <DeployExtension Condition="'$(MSBuildRuntimeType)' == 'Core'">false</DeployExtension>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.VisualStudio.Sdk" />
    <PackageReference Include="Microsoft.VSSDK.BuildTools" PrivateAssets="all" />
  </ItemGroup>

  <Target Name="GetVsixVersion" Returns="$(VsixVersion)">
    <PropertyGroup>
      <VsixVersion Condition="'$(VersionSuffixDateStamp)' != ''">$(VersionPrefix).$(VersionSuffixDateStamp)$(VersionSuffixBuildOfTheDayPadded)</VsixVersion>
    </PropertyGroup>
  </Target>

  <!-- Order matters here. VSSDK appends to PrepareForRunDependsOn but Microsoft.NET.Sdk overwrites it. See https://github.com/dotnet/msbuild/issues/2393. -->
  <Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
  <Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition="Exists('$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets') and '$(OS)' == 'Windows_NT' And '$(Architecture)' == 'x64'" />

</Project>

jjonescz avatar Mar 10 '25 13:03 jjonescz

@jjonescz It used to be that the VS VSIX tooling was only supported on Framework. This may very well no longer be the case, and the opt-outs may be removed.

mmitche avatar Mar 10 '25 15:03 mmitche