I'm getting below warning while publishing azure function in Visual Studio 2019.
Could not evaluate 'Cosmos.CRTCompat.dll' for extension metadata. Exception message: Bad IL format. Could not evaluate 'Microsoft.Azure.Documents.ServiceInterop.dll' for extension metadata. Exception message: Bad IL format.
I tried the same in a blank project but the same warning coming.
Same issue I can see with VS Code
C:\Users\pankaj.ra.nuget\packages\microsoft.azure.webjobs.script.extensionsmetadatagenerator\1.1.5\build\Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator.targets(63,5): warning : Could not evaluate 'Cosmos.CRTCompat.dll' for extension metadata. Exception message: Bad IL format.
My function proj file
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<AzureFunctionsVersion>v3</AzureFunctionsVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.EventHubs" Version="4.1.1" />
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="3.0.5" />
</ItemGroup>
<ItemGroup>
<None Update="host.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="local.settings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToPublishDirectory>Never</CopyToPublishDirectory>
</None>
</ItemGroup>
</Project>