[英]Library System.Threading.Tasks.Extensions not loaded on Azure web app
Since I added a reference to Azure.Container.Blob on my .net 4.8 web app I had several issues with the libraries used by the package. Since I added a reference to Azure.Container.Blob on my .net 4.8 web app I had several issues with the libraries used by the package. I managed to solve most of the issues but I am stuck with this one when I try to load a page:我设法解决了大部分问题,但是当我尝试加载页面时,我被这个问题困住了:
Could not load file or assembly 'System.Threading.Tasks.Extensions, Version=4.2.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'System.Threading.Tasks.Extensions, Version=4.2.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.
On compilation there is no issue, and on my local dev server there is no issue as well, even during the load of said pages.在编译时没有问题,在我的本地开发服务器上也没有问题,即使在加载所述页面时也是如此。
I have this setting in my web.config我的 web.config 中有这个设置
<dependentAssembly>
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1" />
</dependentAssembly>
Which should be managed by the app but it can't find it as shown on the error page:应该由应用程序管理,但找不到它,如错误页面所示:
[FileNotFoundException: Could not load file or assembly 'System.Threading.Tasks.Extensions, Version=4.2.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.]
[FileNotFoundException: Could not load file or assembly 'System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.]
It appears that the dll is not copied into the publish directory by MSBuild, which make the deploy to server not copy it either (as it does not exists). dll 似乎没有被 MSBuild 复制到发布目录中,这使得部署到服务器也不会复制它(因为它不存在)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.