I have just upgraded from WebApi beta to the latest WebApi packages from NuGet. The visual studio project I am using targets .NET 4.0 and not 4.5.
I have been able to resolve all issues but one. I am uploading files using Multipart Form via the following code:
// Verify that this is an HTML Form file upload request
if (!Request.Content.IsMimeMultipartContent("form-data"))
{
throw new HttpResponseException(HttpStatusCode.UnsupportedMediaType);
}
var task = Request.Content.ReadAsMultipartAsync();
var dateField = task.Result.FirstDispositionNameOrDefault("expireby");
if (dateField == null)
{
return this.SendResponse(HttpStatusCode.BadRequest, ":dateNotFound:");
}
var dateFieldValue = dateField.ReadAsStringAsync().Result;
if (!DateTime.TryParse(dateFieldValue, out expireBy))
{
return this.SendResponse(HttpStatusCode.BadRequest, ":invalidDateFormat:");
}
The method FirstDispositionNameOrDefault is not getting compiled anymore and I get the following error:
'System.Net.Http.MultipartMemoryStreamProvider' does not contain a
definition for 'FirstDispositionNameOrDefault' and no extension method
'FirstDispositionNameOrDefault' accepting a first argument of type
'System.Net.Http.MultipartMemoryStreamProvider' could be found (are
you missing a using directive or an assembly reference?)
Google did not return any relevant results. Can someone provide insight into this issue?