【问题标题】:Xamarin.iOS System.MissingMethodException: Method 'HttpResponseMessage.get_StatusCode'Xamarin.iOS System.MissingMethodException:方法'HttpResponseMessage.get_StatusCode'
【发布时间】:2015-08-09 11:36:50
【问题描述】:

在 Visual Studio 上,当尝试使用 HttpResponseMessage 来获取对 HttpClient.PostAsync 调用的响应时,我抛出了这个异常:

System.MissingMethodException: Method 'HttpResponseMessage.get_StatusCode' not found.

奇怪的是我在 Xamarin Studio 上没有这个例外。

调用是在链接到我的 ios 应用程序的 PCL 上进行的。

提前感谢您的帮助

【问题讨论】:

    标签: c# ios visual-studio xamarin xamarin.ios


    【解决方案1】:

    在尝试了很多事情之后,我终于找到了解决方案。 前段时间修复了 CS0012 错误(这些错误不会出现在 Xamarin Studio 上):

    Severity    Code    Description Project File    Line
    Error   CS0012  The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.   RiseUp.Framework.iO
    

    通过添加那些缺少的 Visual Studio 引用。

    解决方法是删除那些引用(system.runtime、system.Globalization 等...)。

    现在从错误列表中删除这些错误的解决方法是仅显示构建错误而不是 Build + Intellisense 错误。 那些 CS0012 错误似乎是 Xamarin 与 Visual Studio 的错误。

    【讨论】:

      猜你喜欢
      • 2011-04-01
      • 2011-12-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-10-25
      • 2020-11-25
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多