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