Asp.net MVC FileStreamResult导致Windows Phone上出现内部服务器错误

Asp.net MVC FileStreamResult导致Windows Phone上出现内部服务器错误,asp.net,asp.net-mvc,asp.net-mvc-4,Asp.net,Asp.net Mvc,Asp.net Mvc 4,我有一个MVC操作,它返回FileStreamResult,如下所示 Public Function Download(ByVal id As Integer) As ActionResult Dim document As Document = db.Documents.Find(id) If document IsNot Nothing AndAlso document.Position.License.IdLicense = SessionManager.User.Id

我有一个MVC操作,它返回FileStreamResult,如下所示

Public Function Download(ByVal id As Integer) As ActionResult
     Dim document As Document = db.Documents.Find(id)
     If document IsNot Nothing AndAlso document.Position.License.IdLicense = SessionManager.User.IdLicense Then
          Return New FileStreamResult(New MemoryStream(document.Data), document.MimeType)
      Else
          Return New HttpStatusCodeResult(HttpStatusCode.Forbidden)
      End If
End Function
这可以在我的桌面上使用win 8.1,但不能在我的windows phone上使用。结果是内部服务器错误http状态代码500


代码中有什么错误吗?

一次尝试/捕获、一些日志记录或详细的HTTP响应可能会有很大帮助……没错。。。与我使用的会话变量有关。由于某些原因,它们在windows phone环境中为空,但在桌面上工作。