Missing application DLL when deploying to Azure App Service

I get the following error after publishing to Azure App Service.

Could not load file or assembly 'Microsoft.ApplicationInsights, Version = 1.2.0.5639, Culture = neutral, PublicKeyToken = 31bf3856ad364e35' or one of its dependencies. The system cannot find the file.

In the WebAPI project, I clearly see the Microsoft.ApplicationInsights link, and the version number is "1.2.0.5639".

I use VSO as my build server (vNext is not XAML based). I noticed in VSO build logs that I am getting a warning that the DLL is also missing.

C: \ Program Files (X86) \ MSBuild \ 14.0 \ Bin \ Microsoft.Common.CurrentVersion.targets (1819.5): warning MSB3245: Failed to resolve this link. The assembly "Microsoft.ApplicationInsights, Version = 1.2.0.5639, Culture = Neutral, PublicKeyToken = 31bf3856ad364e35, processorArchitecture = MSIL" could not be found. Verify that the assembly exists on disk. If this link is required by your code, you may get compilation errors.

The build server also shows this clearly:

The main link is "Microsoft.ApplicationInsights, Version = 1.2.0.5639, Culture = Neutral, PublicKeyToken = 31bf3856ad364e35, processorArchitecture = MSIL".

With the following warning:

[warning] C: \ Program Files (x86) \ MSBuild \ 14.0 \ bin \ Microsoft.Common.CurrentVersion.targets (1819.5):

MSB3245: . "Microsoft.ApplicationInsights, Version = 1.2.0.5639, = , PublicKeyToken = 31bf3856ad364e35, processorArchitecture = MSIL". , . , .

, , - MSIL?

: 3 - ( Application Insights). webjobs "webjobs-list.json", , . , 2/3 - DLL

2: WebJobs JSON .

3: , . , Visual Studio IDE, VSO.: * ( Visual Studio, WebAPI, Application Insights " ". , App Insights . , , web.config. Build/deploy WebAPI . WebJobs JSON.

+4
3

, DLL , Copy Local "True"

0

- , ? VSO ? , SolutionDir,

0

, Application Insights Solution Explorer Visual Studio, NuGet (-) .

, , , Visual Studio Team Services. , VSTS, , .

, , NuGet , " Insights Telemetry..." package.config .

, NuGet , packages.config.

:

<package id="Microsoft.ApplicationInsights" version="2.1.0" targetFramework="net45" />
<package id="Microsoft.ApplicationInsights.Agent.Intercept" version="1.2.1" targetFramework="net45" />

My solution was to undo my changeset that Application Insights added in case something else was broken that I didn't know about, and then use the context menu option to add it back. The second time around it worked correctly.

0
source

Source: https://habr.com/ru/post/1612096/


All Articles