加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

.net – 部署到Azure App Service时缺少Application Insights DL

发布时间:2020-12-14 05:38:21 所属栏目:Windows 来源:网络整理
导读:发布到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 spe
发布到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 specified.

在WebAPI项目中,我清楚地看到Microsoft.ApplicationInsights引用,版本号是“1.2.0.5639”.

我使用VSO作为我的构建服务器(vNext不是基于XAML).我注意到在VSO构建日志中我收到了一条警告,说明DLL也丢失了.

C:Program Files
(x86)MSBuild14.0binMicrosoft.Common.CurrentVersion.targets(1819,5):
warning MSB3245: Could not resolve this reference. Could not locate
the assembly “Microsoft.ApplicationInsights,Version=1.2.0.5639,
Culture=neutral,PublicKeyToken=31bf3856ad364e35,
processorArchitecture=MSIL”. Check to make sure the assembly exists on
disk. If this reference is required by your code,you may get
compilation errors.

构建服务器也清楚地显示了这个:

Primary reference “Microsoft.ApplicationInsights,
processorArchitecture=MSIL”.

有以下警告:

[warning]C:Program Files (x86)MSBuild14.0binMicrosoft.Common.CurrentVersion.targets(1819,5):

Warning MSB3245: Could not resolve this reference. Could not locate
the assembly “Microsoft.ApplicationInsights,you may get
compilation errors.

我现在唯一能想到的可能是处理器架构是MSIL的问题吗?

更新:我还发布了3个Web作业(每个作业用户凭借自己的权限).目前我将webjobs包含在’webjobs-list.json’文件中,但是我将其删除以希望隔离问题.似乎2/3 webjobs能够找到DLL并将其复制到他们的

更新2:从JSON文件中删除WebJobs没有帮助.

更新3:好的,所以我设法让它工作.但是,仅当我从Visual Studio IDE部署时,而不是通过我在VSO上的自动构建. :*(我通过右键单击WebAPI项目然后查找Application Insights菜单项并使用’添加应用程序洞察向导’来使用Visual Studio上下文菜单.这很奇怪,因为App Insights在此项目中已经工作了很长时间.但是在我将它链接到我现有的应用洞察实例后,它在web.config中添加了一些条目.构建/部署让WebAPI重新开始工作.我甚至在WebJobs中添加回JSON文件.

解决方法

确保DLL的属性视图中Copy Local设置为“True”

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读