Web api working locally but not when deployed to Azure

asp.net-web-api2 azure-sql-database c# ef-code-first entity-framework-6

Accepted Answer

I have found a solution just now! I was engaged in

public IQueryable<Conversation> GetConversations()
{
    return db.Conversations;
}

It must have been a serialization issue because it functions as intended when modified to:

public IEnumerable<Conversation> GetConversations()
{
    return db.Conversations.ToList();
}

A few days were lost on something so trivial!

0
3/6/2016 4:04:52 PM

Popular Answer

Without debugging, it is difficult to pinpoint the issue.

Any logger, such as log4net or sirilog, may be used to record problems in actions or methods that return HTTP 500, or it can utilize the Code live-debugging in Azure code.

Additionally, if the entire web API application failed to run (returns an internal server error), it is likely due to configuration issues (such as using the incorrect ConnectionString). However, if some of your actions return 200 while others return 500, you should debug your code or keep a log of your errors to identify the precise exception.



Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow