Asp.Net Web API Error: The 'ObjectContent`1' type failed to serialize the response body for content type 'application/xml; charset=utf-8'

前端 未结 8 1645
天命终不由人
天命终不由人 2020-11-27 16:56

Simplest example of this, I get a collection and try to output it via Web API:

// GET api/items
public IEnumerable Get()
{
    return MyContext.I         


        
8条回答
  •  清歌不尽
    2020-11-27 17:32

    In my Project EntityCollection returned from the WebApi action method. Configuration.ProxyCreationEnabled = false not applicable. I have tried the below approach it is working fine for me.

    1. Control Panel. 2.Turn on Windows Features on or off
    2. Choose Internet Information Service
    3. Check all the World Wide Web Components it would be better to check all the components in IIS.
    4. Install the components.
    5. Go to (IIS) type inetmgr in command prompt.
    6. select the published code in the Virtual directory.
    7. Convert into application
    8. Browse it the application.

提交回复
热议问题