diff --git a/src/Microsoft.AspNet.Mvc.Razor.Host/MvcRazorHost.cs b/src/Microsoft.AspNet.Mvc.Razor.Host/MvcRazorHost.cs
index 4f7cc4ec85..0c54131bbe 100644
--- a/src/Microsoft.AspNet.Mvc.Razor.Host/MvcRazorHost.cs
+++ b/src/Microsoft.AspNet.Mvc.Razor.Host/MvcRazorHost.cs
@@ -128,11 +128,8 @@ namespace Microsoft.AspNet.Mvc.Razor
{
// Adding a prefix so that the main view class can be easily identified.
var className = MainClassNamePrefix + ParserHelpers.SanitizeClassName(rootRelativePath);
- using (var reader = new StreamReader(inputStream))
- {
- var engine = new RazorTemplateEngine(this);
- return engine.GenerateCode(reader, className, DefaultNamespace, rootRelativePath);
- }
+ var engine = new RazorTemplateEngine(this);
+ return engine.GenerateCode(inputStream, className, DefaultNamespace, rootRelativePath);
}
///
diff --git a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/Runtime/Basic.cs b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/Runtime/Basic.cs
index edabf5796d..da1fe1ade0 100644
--- a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/Runtime/Basic.cs
+++ b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/Runtime/Basic.cs
@@ -1,4 +1,5 @@
-namespace Asp
+#pragma checksum "TestFiles/Input/Basic.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "63d2634be31f68aa89a0c1561d67c73cc446f3d4"
+namespace Asp
{
using System;
using System.Linq;
@@ -28,13 +29,22 @@
{
WriteLiteral("
(logo, 12), false));
- WriteLiteral(">\r\n Hello world\r\n ");
-#line 3 "TestFiles/Input/Basic.cshtml"
-Write(Html.Input("SomeKey"));
+ Tuple.Create(Tuple.Create("", 12), Tuple.Create(
+#line 1 "TestFiles/Input/Basic.cshtml"
+ logo
#line default
#line hidden
+ , 12), false));
+ WriteLiteral(">\r\n Hello world\r\n ");
+ Write(
+#line 3 "TestFiles/Input/Basic.cshtml"
+ Html.Input("SomeKey")
+
+#line default
+#line hidden
+ );
+
WriteLiteral("\r\n
");
}
#pragma warning restore 1998
diff --git a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/Runtime/Inject.cs b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/Runtime/Inject.cs
index 8ee25d6779..7ee1da2970 100644
--- a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/Runtime/Inject.cs
+++ b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/Runtime/Inject.cs
@@ -1,4 +1,5 @@
-namespace Asp
+#pragma checksum "TestFiles/Input/Inject.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "424b7fe9f12352c59210b5fa8c74ca8c9c67de81"
+namespace Asp
{
#line 1 "TestFiles/Input/Inject.cshtml"
using MyNamespace
diff --git a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/Runtime/InjectWithModel.cs b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/Runtime/InjectWithModel.cs
index b818f61025..71e268b817 100644
--- a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/Runtime/InjectWithModel.cs
+++ b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/Runtime/InjectWithModel.cs
@@ -1,4 +1,5 @@
-namespace Asp
+#pragma checksum "TestFiles/Input/InjectWithModel.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "0c0e10d3fd8f5bf30eabc22ca0ee91355a13426d"
+namespace Asp
{
using System;
using System.Linq;
diff --git a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/Runtime/Model.cs b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/Runtime/Model.cs
index 3562ebb821..a49b51ab72 100644
--- a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/Runtime/Model.cs
+++ b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/Runtime/Model.cs
@@ -1,4 +1,5 @@
-namespace Asp
+#pragma checksum "TestFiles/Input/Model.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "2c1e88396568d309c236020e59bf2abacfadd612"
+namespace Asp
{
using System;
using System.Linq;