2 回答

TA貢獻1951條經(jīng)驗 獲得超3個贊
我有同樣的問題,但沒有解決方案。我將其追溯到函數(shù)中MobileServiceHttpClient代碼中的以下代碼行SendRequestAsync(...)。
// If there was supposed to be response content and there was not, throw
if (ensureResponseContent)
{
long? contentLength = null;
if (response.Content != null)
{
contentLength = response.Content.Headers.ContentLength;
}
if (contentLength == null || contentLength <= 0)
{
throw new MobileServiceInvalidOperationException("The server did not provide a response with the expected content.", request, response);
}
}
看著response.Content.Headers.ContentLength它是null。將應(yīng)用程序作為 2.0 Core 項目運行,該值已正確填寫。奇怪的是內(nèi)容在那里。
如果您深入了解私有成員,其中一些已正確設(shè)置。
catch (MobileServiceInvalidOperationException msioe)
{
//content will contain the correct json but the ContentLenth is null!?!
string content = await msioe.Response.Content.ReadAsStringAsync();
}
這是一個 2.1 核心問題。希望他們修復(fù)它。
- 2 回答
- 0 關(guān)注
- 191 瀏覽
添加回答
舉報