Azure / azure-functions-vs-build-sdk

MSBuild task for Azure Functions
MIT License
95 stars 64 forks source link

4.0.0-preview1 MSB4062 GenerateFunctions task strong name signing error #527

Closed ssa3512 closed 2 years ago

ssa3512 commented 2 years ago

I am attempting to try out upgrading to .NET 6 in preview with the 4.0.0-preview1 package but can not build my functions app:

VS 2022 preview 4

MSB4062 The "GenerateFunctions" task could not be loaded from the assembly C:\Users\SSAshman.nuget\packages\microsoft.net.sdk.functions\4.0.0-preview1\build..\tools\net6.0\Microsoft.NET.Sdk.Functions.MSBuild.dll. Could not load file or assembly 'Microsoft.NET.Sdk.Functions.MSBuild, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. Strong name validation failed. (Exception from HRESULT: 0x8013141A) Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.

.csproj is very simple:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>net6.0</TargetFramework>
    <AzureFunctionsVersion>v4</AzureFunctionsVersion>
  </PropertyGroup>

  <ItemGroup>
    <AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
        <_Parameter1>$(MSBuildProjectName)Tests</_Parameter1>
    </AssemblyAttribute>
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.0.0-preview1" />
  </ItemGroup>

  <ItemGroup>
    <None Update="host.json">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </None>
    <None Update="local.settings.json">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
      <CopyToPublishDirectory>Never</CopyToPublishDirectory>
    </None>
  </ItemGroup>

</Project>

Is there anything I am missing?

ssa3512 commented 2 years ago

This seems to be resolved in preview 2 and preview 1 was delisted from nuget.org