Web App突然开始出现错误-找不到方法:'System.Collections.ObjectModel.Collection`1< System.Net.Http.Headers.MediaTypeHeaderValue> System.Net.Http.Formatting.MediaTypeFormatter.get_SupportedMediaTypes()'. [英] Web App suddenly started giving error - Method not found: 'System.Collections.ObjectModel.Collection`1<System.Net.Http.Headers.MediaTypeHeaderValue> System.Net.Http.Formatting.MediaTypeFormatter.get_SupportedMediaTypes()'.

查看:1619
本文介绍了Web App突然开始出现错误-找不到方法:'System.Collections.ObjectModel.Collection`1< System.Net.Http.Headers.MediaTypeHeaderValue> System.Net.Http.Formatting.MediaTypeFormatter.get_SupportedMediaTypes()'.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尊敬的会员,

今天,我们遇到了一个与Azure Web Apps有关的有趣问题.这是细节.

问题:
>我们的应用程序基于具有MVC 5.2.3和WebApi 5.2.2的.NET Framework 4.6.2构建.
>该应用程序已运行了4年,WebApps没有任何问题.
>今天,我们在Azure Web App中发布了该应用程序,并开始抛出以下错误:

找不到方法:
'System.Collections.ObjectModel.Collection`1< System.Net.Http.Headers.MediaTypeHeaderValue> System.Net.Http.Formatting.MediaTypeFormatter.get_SupportedMediaTypes()'.

我们不确定为什么它突然开始出现此错误:( 

我们试图解决/解决问题的方法:
>从VS2017将网站多次发布到Azure Web Apps,但是它引发了相同的错误.
>发布后,我们多次重新启动了WebApp,但仍然抛出错误.
>我们在基础架构中的IIS中发布了我们的解决方案,它运行良好!是的,它在我们的服务器上工作正常.
>我们通过KUDU控制台将本地发布的内容复制到WebApp中,然后重新启动了WebApp,但错误不断抛出.
>最后,我们将MVC版本从5.2.3更新到5.2.4,然后再次发布,它开始起作用!!!

Azure Web Apps的行为非常有趣,此实例引发了很多问题.

有人可以帮助我们为什么会这样吗?为什么在MVC升级后它开始工作?但是,它在一天前还不错.

注意:
在Azure Portal中,MVC升级前后,Web应用程序的.NET框架版本为4.7.
它正在工作,但是今天突然停止了.

Dear Members,

Today, we faced an interesting issue with Azure Web Apps. Here is the detail.

Issue:
> Our application is built on .NET Framework 4.6.2 with MVC 5.2.3 and WebApi 5.2.2
> The application has been running for the last 4 years without any issue with WebApps.
> Today, we published the application in Azure Web App and started throwing below error:

Method not found: 
'System.Collections.ObjectModel.Collection`1<System.Net.Http.Headers.MediaTypeHeaderValue> System.Net.Http.Formatting.MediaTypeFormatter.get_SupportedMediaTypes()'.

We are not sure why it suddenly started giving this error :( 

What we tried to resolve/troubleshoot the issue:
> Published the site many times from VS2017 to Azure Web Apps, but it was throwing the same error.
> We restarted the WebApps many times after publish, but still error was throwing.
> We published our solution in IIS in our infrastructure, it is working fine! Yeah, it is working fine in our server.
> We copied locally publish content into WebApps through KUDU console and restarted the WebApp but the error was throwing continously.
> Finally, we updated our MVC version to 5.2.4 from 5.2.3 and published it again and it started working!!!

It is really interesting behavior of Azure Web Apps and this instance throws so many questions.

Can anybody help us why it was happened? Why it started working after upgradation of MVC? However, it was working fine a day befeore ago.

NOTE:
In Azure Portal, .NET framwork version of the Web App is 4.7 before and after MVC upgradation. 
It was working but stopped suddenly today.

Any feedback is really appreciated.

推荐答案

绑定重定向到System.Net.Http SO线程以获取更多详细信息.

This specific error indicates that you need to binding redirect to System.Net.Http. However, in the new updated version its automatically redirected. Refer to this SO thread for more details.



这篇关于Web App突然开始出现错误-找不到方法:'System.Collections.ObjectModel.Collection`1&lt; System.Net.Http.Headers.MediaTypeHeaderValue&gt; System.Net.Http.Formatting.MediaTypeFormatter.get_SupportedMediaTypes()'.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆