【问题标题】:Windows azure sample execution problemsWindows azure 示例执行问题
【发布时间】:2015-01-31 10:30:34
【问题描述】:

我正在研究windows azure的移动服务,这篇文章http://blogs.msdn.com/b/azuremobile/archive/2014/05/27/how-to-expand-linked-entities-from-mobileservices-client-and-mobileservices-service.aspx

但是当我在本地运行服务时,我得到以下异常

An exception has occurred while using the formatter 'JsonMediaTypeFormatter' to generate sample for media type 'application/json'. Exception message: One or more errors occurred.

【问题讨论】:

    标签: c# .net azure mobile service


    【解决方案1】:

    你可以看这篇文章

    JSON and XML Serialization in ASP.NET Web API

    在 Azure 移动服务中,你需要在 WebApiConfig 类中做

    var config = ServiceConfig.Initialize(new ConfigBuilder(options));
    config.Formatters.Clear();
    config.Formatters.Add(new JsonMediaTypeFormatter());

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-11-18
      • 2016-04-14
      • 2013-04-25
      • 1970-01-01
      相关资源
      最近更新 更多