microsoft / ApplicationInsights-dotnet-logging

.NET Logging adaptors
106 stars 49 forks source link

Azure Function v2 failure #318

Closed rwil02 closed 5 years ago

rwil02 commented 5 years ago
  <PropertyGroup>
    <TargetFramework>netcoreapp2.1</TargetFramework>
    <AzureFunctionsVersion>v2</AzureFunctionsVersion>
  </PropertyGroup>

Adding NLog 4.6.7 (can reference in code) Adding Microsoft.ApplicationInsights 2.11.0 (can reference in code) Adding Microsoft.ApplicationInsights.NLogTarget 2.11.0 (cannot reference in code)

Error is: NLogTarget does not exist in the namespace Microsoft.ApplicationInsights However, looking in the object browser I can browse to Microsoft.ApplicationInsights.NLogTarget.ApplicationInsightsTarget

These are my packages:

<ItemGroup>
    <PackageReference Include="Microsoft.ApplicationInsights" Version="2.11.0" />
    <PackageReference Include="Microsoft.ApplicationInsights.NLogTarget" Version="2.11.0" />
    <PackageReference Include="Microsoft.NET.Sdk.Functions" Version="1.0.29" />
    <PackageReference Include="NLog" Version="4.6.7" />
    <PackageReference Include="System.Data.SqlClient" Version="4.5.1" />
  </ItemGroup>

Last time I had this issue with a package, it had to do with a version conflict, but I don't see one this time.

cijothomas commented 5 years ago

Can you use Application Insights 2.10? 2.11 is not yet supported in functions. https://github.com/microsoft/ApplicationInsights-dotnet/issues/1223#issuecomment-535721296

rwil02 commented 5 years ago

That did it. Both packages had to be rolled back to 2.10

cijothomas commented 5 years ago

closing as no action of application insight sdk.