msix-packaging icon indicating copy to clipboard operation
msix-packaging copied to clipboard

[BUG] MsBuild 17.0

Open mtbayley opened this issue 4 years ago • 4 comments

Project MSIX SDK DevOps Extension

Describe the bug Please allow MsBuild 17.0 to be used so we can use .Net 6 in our pipelines

C:\Program Files\dotnet\sdk\6.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.DefaultItems.targets(134,5): warning NETSDK1182: Targeting .NET 6.0 in Visual Studio 2019 is not supported.

mtbayley avatar Nov 22 '21 17:11 mtbayley

The MSIX Packaging task can only use the version of MSBuild that you have installed in your agent. So first you need to ensure that MSBuild 17.0 is installed.

Then, you need to point the packaging task to it. There is an input for choosing which version of MSBuild to use. You can set the msbuildLocationMethod to version (automatically find MSBuild by version; this is the default) and then set msbuildVersion to an appropriate version. We currently don't have 17.0 here, but I think latest should work. If that doesn't work, you can change msbuildLocationMethod to location and then set msbuildLocation manually.

On our side, we do need to update the MSBuild location logic to accept 17.0 as input, but this shouldn't block you as you can set the path manually.

florelis avatar Nov 22 '21 22:11 florelis

Thanks, I found out later that you can set the path explicitly. I can confirm that latest will only return MSBuild 16.0

mtbayley avatar Nov 22 '21 23:11 mtbayley

When manually referencing the msbuild version ( 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Msbuild\Current\Bin\MSBuild.exe') the packaged msix does not contain any of the package references e.g.

   <PackageReference Include="Microsoft.WindowsAppSDK" Version="[1.0.0]">
      <IncludeAssets>build</IncludeAssets>
    </PackageReference>
    <PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="[10.0.22000.194]">
      <IncludeAssets>build</IncludeAssets>
    </PackageReference>

EddyHaigh avatar Feb 03 '22 22:02 EddyHaigh

msbuildVersion: '17.0' also doesn't work, but this does:

msbuildLocationMethod: location
msbuildLocation: 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Msbuild\Current\Bin\MSBuild.exe'

Will the task be updated at some point?

MisinformedDNA avatar Feb 10 '23 22:02 MisinformedDNA