2
votes

Visual Studio VS 2017, v. 15.4.5 Since webjob for .net core is not yet available, I'm creating it for .net framework 4.6.1: New - Project - Visual C# - Cloud - Azure WebJob (.NET Framework)

Then I follow instructions from https://github.com/Azure/azure-webjobs-sdk/wiki/Application-Insights-Integration and adding Microsoft.Azure.WebJobs.Logging.ApplicationInsights v. 3.0.0-beta4:

Attempting to gather dependency information for package 'Microsoft.Azure.WebJobs.Logging.ApplicationInsights.3.0.0-beta4' with respect to project 'WebJob2', targeting '.NETFramework,Version=v4.6.1'

it does a lot of things, but at the end in Solution Explorer\References everything looks fine except two dlls which are marked as missing:

  • (missing) System.Diagnostics.TraceSource

  • (missing) System.Threading.Thread

Packages.config has the following lines:

<package id="System.Diagnostics.TraceSource" version="4.3.0" targetFramework="net461" />
<package id="System.Threading.Thread" version="4.3.0" targetFramework="net461" />

but looks like both those packages does not support 4.6.1 (if I switch to framework 4.6 everything is fine and missing references gone, BUT i couldn't use ILoggerFactory, which is essential part of AppInsights integration and requires support of net standard 2.0)

Can someone advise, how to resolve this situation? It looks, like they are trying to use .net core library in .net framework app or something. I'm confused.

1

1 Answers

0
votes

it does a lot of things, but at the end in Solution Explorer\References everything looks fine except two dlls which are marked as missing.

According to your steps, I also created a Web Job project(.net 4.6.1). In Tools>Nuget Package Manage>Package Manager Console, I enter the following command, the package then includes the two except dlls.

Install-Package Microsoft.Azure.WebJobs.Logging.ApplicationInsights -Version 3.0.0-beta4

But the AddConsole method could not be used in my project. So I also need to add ‘Microsoft.Extensions.Logging.Console’ in Manage Nuget packages. Then it works fine.

enter image description here

It looks, like they are trying to use .net core library in .net framework app or something.

You could see the dependencies in package from this Nuget link,the .NET Core or Web Job library are OK. And .NET Standard 2.0 is supported with .net 4.6.1(not 4.6.0). You could read this article to learn more about the compatibility of .NET Standard version.