简体   繁体   English

无法加载文件或程序集“Microsoft.AI.Web”或其依赖项之一。 系统找不到指定的文件

[英]Could not load file or assembly 'Microsoft.AI.Web' or one of its dependencies. The system cannot find the file specified

After successfully publishing my Web Api to Azure when i try to hit the api i get the following error.将我的 Web Api 成功发布到 Azure 后,当我尝试点击 api 时,出现以下错误。

Here's a link to api这是api的链接

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value
[HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.

Note: There is some performance penalty associated with assembly bind failure logging.注意:有一些与程序集绑定失败日志相关的性能损失。 To turn this feature off, remove the registry value [HKLM\\Software\\Microsoft\\Fusion!EnableLog] .要关闭此功能,请删除注册表值[HKLM\\Software\\Microsoft\\Fusion!EnableLog]

I solved this problem by doing this:我通过这样做解决了这个问题:

Install-Package Microsoft.ApplicationInsights.Web

To install Application Insights only to the Web/API Project:仅将 Application Insights 安装到 Web/API 项目:

Install-Package Microsoft.ApplicationInsights.Web YourProjectName

To run these commands, in Visual Studio open Package Manager by clicking on: Tools -> NuGet Package Manager -> Package Manager Console要运行这些命令,请在 Visual Studio 中通过单击打开包管理器:工具 -> NuGet 包管理器 -> 包管理器控制台

Using "Manage NuGet Packages" I tired to install Microsoft.ApplicationInsights.Web .使用“管理 NuGet 包”我厌倦了安装Microsoft.ApplicationInsights.Web It was already installed.它已经安装了。 I gave an "Update".我给了一个“更新”。 After rebuild application, the error is gone.重建应用程序后,错误消失了。

I have reproduce this type issue.我已经重现了这种类型的问题。 Here is my reproduce process:这是我的重现过程:

1) Create web App api with Microsoft.ApplicationInsights.Web installed.
2) Then deploy the App to Azure Web app.

Here is the web API worked screenshot:这是 Web API 工作截图: 在此处输入图片说明

Then I open KUDU tool, delete Microsoft.AI.Web in Bin folder, and run the site again.然后我打开 KUDU 工具,删除 Bin 文件夹中的 Microsoft.AI.Web,然后再次运行该站点。 I get the same error with you, here is the screenshot:我和你有同样的错误,这是屏幕截图: 在此处输入图片说明

So I can ensure that, this error is caused by the assembly Microsoft.AI.Web is missing.所以我可以确定,这个错误是由缺少 Microsoft.AI.Web 程序集引起的。 Please set the copy local as true as following screenshot, then redeploy to Azure web App:请按照以下屏幕截图将本地副本设置为 true,然后重新部署到 Azure Web 应用程序: 在此处输入图片说明

Pls, check this answer :请检查这个答案

You will need to include the dll with your project and add a reference to it as well.您需要在项目中包含 dll 并添加对它的引用。

Here is a link to a similar issue already on Stack: MVC3 Deployment Dependency Problems这是堆栈上已有类似问题的链接: MVC3 部署依赖问题

All the Answers about "Install-Package Microsoft.ApplicationInsights.Web" are not directly solved the Error in my case.在我的情况下,所有关于“Install-Package Microsoft.ApplicationInsights.Web”的答案都没有直接解决错误。 My WebApplication-Project did not accept the Installing of the Package (Rollback after a few Minutes of installing).我的 WebApplication-Project 不接受安装包(安装几分钟后回滚)。

Then I tried to add the NuGetPacke for Microsoft.ApplicationInsights.Web into a Library-Project, which my WebApplication use.然后我尝试将 Microsoft.ApplicationInsights.Web 的 NuGetPacke 添加到我的 WebApplication 使用的库项目中。 That added the AI.Web-DLLs also to my WebApplication and solved the Problem.这也将 AI.Web-DLL 添加到我的 WebApplication 中并解决了问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何解决“无法加载文件或程序集“Microsoft.AI.Web”或其依赖项之一的错误? - How to solve 'Could not load file or assembly 'Microsoft.AI.Web' or one of its dependencies' error? 无法加载文件或程序集 'System.Web.WebPages.Razor,版本 = 1.0.0.0 或其依赖项之一。 该系统找不到指定的文件 - Could not load file or assembly 'System.Web.WebPages.Razor, Version=1.0.0.0 or one of its dependencies. The system cannot find the file specified 无法加载文件或程序集“ Microsoft.Data.Service”或其依赖项之一。 该系统找不到指定的文件 - Could not load file or assembly 'Microsoft.Data.Service' or one of its dependencies. The system cannot find the file specified 无法加载文件或程序集“Microsoft.AspNet.TelemetryCorrelation”或其依赖项之一。 该系统找不到指定的文件 - Could not load file or assembly 'Microsoft.AspNet.TelemetryCorrelation' or one of its dependencies. The system cannot find the file specified 无法加载文件或程序集的“扩展名”或其依赖项之一。 该系统找不到指定的文件 - Could not load file or assembly 'Extensions' or one of its dependencies. The system cannot find the file specified 无法加载文件或程序集“ Ajax”或其依赖项之一。 该系统找不到指定的文件 - Could not load file or assembly 'Ajax' or one of its dependencies. The system cannot find the file specified 具体:无法加载文件或程序集“xxxx”或其依赖项之一。 该系统找不到指定的文件 - A specific: Could not load file or assembly 'xxxx' or one of its dependencies. The system cannot find the file specified 无法加载文件或程序集“ XXX”或其依赖项之一。 该系统找不到指定的文件 - Could not load file or assembly 'XXX' or one of its dependencies. The system cannot find the file specified 无法加载文件或程序集“coba4”或其依赖项之一。 该系统找不到指定的文件 - Could not load file or assembly 'coba4' or one of its dependencies. The system cannot find the file specified 无法加载文件或程序集或其依赖项之一。 该系统找不到指定的文件。 (不允许GAC) - Could not load file or assembly or one of its dependencies. The system cannot find the file specified. (No GAC allowed)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM