Azure-functions-host: Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator >= 1.0.2 + e.g. Microsoft.Win32.Registry = warning

Created on 27 Jan 2020  路  5Comments  路  Source: Azure/azure-functions-host

Investigative information

As in title, having _Microsoft.Win32.Registry_ and _Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator_ in version higher than 1.0.1 in the same project causes warning.

Repro steps

Create console app project with such csproj and try to build it.

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

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp2.2</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.Win32.Registry" Version="4.7.0" />
    <PackageReference Include="Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator" Version="1.0.2" />
  </ItemGroup>

</Project>

Expected behavior

No warning.

Actual behavior

Following warning:
Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator.targets(33, 5): Could not evaluate 'Microsoft.Win32.Registry.dll' for extension metadata. Exception message: Could not load file or assembly 'Microsoft.Win32.Registry, Version=4.1.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.

Known workarounds

Downgrading a package to at least 1.0.1

Related information

One might argue that this behavior is appropriate. Maybe. I'm not familiar with these packages' content.

But having

  • _Microsoft.NET.Sdk.Functions > 1.0.24_ depending on _Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator > 1.0.1_
  • _System.Data.SqlClient = 4.8.0_ depending on _Microsoft.Win32.Registry_

causes my pipelines to fail because I treat warnings as errors and I cannot really accept this. Issue on the Azure Function SDK side is hanging as opened since March 2019.

Thank you for your reply.

error-message-improvement improvement

Most helpful comment

Thank you for your time. It seems that project migration to .NET Core 3.1 is my best bet then. Nevertheless, I consider removal of this warning as an worthwhile improvement that I hope will happen soon.

All 5 comments

Thanks for reporting this issue, @Glaeqen. This warning is intended to be informational, so this statement should be logging a message, not a warning.

This warning doesn't appear when using the 3.x runtime and v1.1.3 of Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator, if you're able to migrate. Example .csproj:

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

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp3.1</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.Win32.Registry" Version="4.7.0" />
    <PackageReference Include="Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator" Version="1.1.3" />
  </ItemGroup>

</Project>

Thank you for your time. It seems that project migration to .NET Core 3.1 is my best bet then. Nevertheless, I consider removal of this warning as an worthwhile improvement that I hope will happen soon.

How do you suppress this warning? Our build environment treats all warnings as errors, so this is a bit of a pain point.

@William-Froelich We have moved to .NET Core 3.1 months ago. Sorry.

Yeah, we're working on that too but our function apps are stuck on 2.2 from another issue with the azure functions library.

Was this page helpful?
0 / 5 - 0 ratings