From 55718fd931e5664e4e1cc59ca1d0086f3c0660cb Mon Sep 17 00:00:00 2001 From: David Fowler Date: Sat, 8 Mar 2014 03:47:38 -0800 Subject: [PATCH] Added required packages for K and fixed the build --- samples/StaticFileSample/project.json | 37 ++++++++++++++----- .../SendFileMiddleware.cs | 5 ++- src/Microsoft.AspNet.StaticFiles/project.json | 29 ++++++++++++--- 3 files changed, 55 insertions(+), 16 deletions(-) diff --git a/samples/StaticFileSample/project.json b/samples/StaticFileSample/project.json index 39a19efd65..547f7af5c5 100644 --- a/samples/StaticFileSample/project.json +++ b/samples/StaticFileSample/project.json @@ -1,5 +1,5 @@ { - "version" : "0.1-alpha-*", + "version": "0.1-alpha-*", "dependencies": { "Microsoft.AspNet.FileSystems": "0.1-alpha-*", "Microsoft.AspNet.StaticFiles": "", @@ -8,14 +8,33 @@ "configurations": { "net45": { "dependencies": { - "Owin": "1.0", - "Microsoft.Owin": "2.1.0", - "Microsoft.Owin.Diagnostics": "2.1.0", - "Microsoft.Owin.Hosting": "2.1.0", - "Microsoft.Owin.Host.HttpListener": "2.1.0", - "Microsoft.AspNet.AppBuilderSupport": "0.1-alpha-*" - } + "Owin": "1.0", + "Microsoft.Owin": "2.1.0", + "Microsoft.Owin.Diagnostics": "2.1.0", + "Microsoft.Owin.Hosting": "2.1.0", + "Microsoft.Owin.Host.HttpListener": "2.1.0", + "Microsoft.AspNet.AppBuilderSupport": "0.1-alpha-*" + } }, - "k10" : { } + "k10": { + "dependencies": { + "System.Console": "4.0.0.0", + "System.Collections": "4.0.0.0", + "System.Diagnostics.Debug": "4.0.10.0", + "System.Diagnostics.Tools": "4.0.0.0", + "System.Globalization": "4.0.10.0", + "System.IO": "4.0.0.0", + "System.IO.FileSystem": "4.0.0.0", + "System.IO.FileSystem.Primitives": "4.0.0.0", + "System.Linq": "4.0.0.0", + "System.Reflection": "4.0.10.0", + "System.Resources.ResourceManager": "4.0.0.0", + "System.Runtime": "4.0.20.0", + "System.Runtime.Extensions": "4.0.10.0", + "System.Runtime.InteropServices": "4.0.10.0", + "System.Text.Encoding": "4.0.10.0", + "System.Threading.Tasks": "4.0.0.0" + } + } } } \ No newline at end of file diff --git a/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs index 18901d981b..edd80424ae 100644 --- a/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs @@ -79,11 +79,12 @@ namespace Microsoft.AspNet.StaticFiles throw new ArgumentOutOfRangeException("length", length, string.Empty); } - Stream fileStream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite, 1024 * 64, #if NET45 + Stream fileStream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite, 1024 * 64, FileOptions.Asynchronous | FileOptions.SequentialScan); #else - useAsync: true); + // TODO: Bring back async when the contract gets it + Stream fileStream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite, 1024 * 64); #endif try { diff --git a/src/Microsoft.AspNet.StaticFiles/project.json b/src/Microsoft.AspNet.StaticFiles/project.json index d524a7eba7..d611e51c7d 100644 --- a/src/Microsoft.AspNet.StaticFiles/project.json +++ b/src/Microsoft.AspNet.StaticFiles/project.json @@ -1,12 +1,31 @@ { "version": "0.1-alpha-*", "dependencies": { - "Microsoft.AspNet.Abstractions" : "0.1-alpha-*", - "Microsoft.AspNet.HttpFeature" : "0.1-alpha-*", - "Microsoft.AspNet.FileSystems" : "0.1-alpha-*" + "Microsoft.AspNet.Abstractions": "0.1-alpha-*", + "Microsoft.AspNet.HttpFeature": "0.1-alpha-*", + "Microsoft.AspNet.FileSystems": "0.1-alpha-*" }, "configurations": { - "net45": { }, - "k10" : { } + "net45": {}, + "k10": { + "dependencies": { + "System.Collections": "4.0.0.0", + "System.Diagnostics.Debug": "4.0.10.0", + "System.Diagnostics.Contracts": "4.0.0.0", + "System.Diagnostics.Tools": "4.0.0.0", + "System.Globalization": "4.0.10.0", + "System.IO": "4.0.0.0", + "System.IO.FileSystem": "4.0.0.0", + "System.IO.FileSystem.Primitives": "4.0.0.0", + "System.Linq": "4.0.0.0", + "System.Reflection": "4.0.10.0", + "System.Resources.ResourceManager": "4.0.0.0", + "System.Runtime": "4.0.20.0", + "System.Runtime.Extensions": "4.0.10.0", + "System.Runtime.InteropServices": "4.0.10.0", + "System.Text.Encoding": "4.0.10.0", + "System.Threading.Tasks": "4.0.0.0" + } + } } } \ No newline at end of file