\r\n | ");
-#line 25 "LogPage.cshtml"
+#line 26 "LogPage.cshtml"
WriteTo(__razor_helper_writer, string.Format("{0:MM/dd/yy}", log.Time));
#line default
#line hidden
WriteLiteralTo(__razor_helper_writer, " | \r\n ");
-#line 26 "LogPage.cshtml"
+#line 27 "LogPage.cshtml"
WriteTo(__razor_helper_writer, string.Format("{0:H:mm:ss}", log.Time));
#line default
#line hidden
WriteLiteralTo(__razor_helper_writer, " | \r\n (log.Name, 844), false));
+ WriteAttributeTo(__razor_helper_writer, "title", Tuple.Create(" title=\"", 871), Tuple.Create("\"", 888),
+ Tuple.Create(Tuple.Create("", 879), Tuple.Create(log.Name, 879), false));
WriteLiteralTo(__razor_helper_writer, ">");
-#line 27 "LogPage.cshtml"
+#line 28 "LogPage.cshtml"
WriteTo(__razor_helper_writer, log.Name);
#line default
#line hidden
WriteLiteralTo(__razor_helper_writer, " | \r\n (log.Severity.ToString().ToLowerInvariant(), 894), false));
+ WriteAttributeTo(__razor_helper_writer, "class", Tuple.Create(" class=\"", 921), Tuple.Create("\"", 972),
+ Tuple.Create(Tuple.Create("", 929), Tuple.Create(log.Severity.ToString().ToLowerInvariant(), 929), false));
WriteLiteralTo(__razor_helper_writer, ">");
-#line 28 "LogPage.cshtml"
+#line 29 "LogPage.cshtml"
WriteTo(__razor_helper_writer, log.Severity);
#line default
#line hidden
WriteLiteralTo(__razor_helper_writer, " | \r\n (log.Message, 982), false));
+ WriteAttributeTo(__razor_helper_writer, "title", Tuple.Create(" title=\"", 1009), Tuple.Create("\"", 1029),
+ Tuple.Create(Tuple.Create("", 1017), Tuple.Create(log.Message, 1017), false));
WriteLiteralTo(__razor_helper_writer, ">\r\n");
-#line 30 "LogPage.cshtml"
+#line 31 "LogPage.cshtml"
#line default
#line hidden
-#line 30 "LogPage.cshtml"
+#line 31 "LogPage.cshtml"
for (var i = 0; i < level; i++)
{
@@ -110,29 +116,29 @@ WriteTo(__razor_helper_writer, string.Format("{0:H:mm:ss}", log.Time));
#line hidden
WriteLiteralTo(__razor_helper_writer, " \r\n");
-#line 33 "LogPage.cshtml"
+#line 34 "LogPage.cshtml"
}
#line default
#line hidden
WriteLiteralTo(__razor_helper_writer, " ");
-#line 34 "LogPage.cshtml"
+#line 35 "LogPage.cshtml"
WriteTo(__razor_helper_writer, log.Message);
#line default
#line hidden
WriteLiteralTo(__razor_helper_writer, "\r\n | \r\n (log.Exception, 1205), false));
+ WriteAttributeTo(__razor_helper_writer, "title", Tuple.Create(" title=\"", 1232), Tuple.Create("\"", 1254),
+ Tuple.Create(Tuple.Create("", 1240), Tuple.Create(log.Exception, 1240), false));
WriteLiteralTo(__razor_helper_writer, ">");
-#line 36 "LogPage.cshtml"
+#line 37 "LogPage.cshtml"
WriteTo(__razor_helper_writer, log.Exception);
#line default
#line hidden
WriteLiteralTo(__razor_helper_writer, " | \r\n
\r\n");
-#line 38 "LogPage.cshtml"
+#line 39 "LogPage.cshtml"
}
#line default
@@ -140,21 +146,21 @@ WriteTo(__razor_helper_writer, log.Message);
}
);
-#line 39 "LogPage.cshtml"
+#line 40 "LogPage.cshtml"
}
#line default
#line hidden
public HelperResult
-#line 41 "LogPage.cshtml"
-Traverse(ScopeNode node, int level)
+#line 42 "LogPage.cshtml"
+Traverse(ScopeNode node, int level, Dictionary counts)
{
#line default
#line hidden
return new HelperResult((__razor_helper_writer) => {
-#line 42 "LogPage.cshtml"
+#line 43 "LogPage.cshtml"
// print start of scope
@@ -162,7 +168,7 @@ Traverse(ScopeNode node, int level)
#line default
#line hidden
-#line 44 "LogPage.cshtml"
+#line 45 "LogPage.cshtml"
WriteTo(__razor_helper_writer, LogRow(new LogInfo()
{
Name = node.Name,
@@ -173,7 +179,7 @@ WriteTo(__razor_helper_writer, LogRow(new LogInfo()
#line default
#line hidden
-#line 50 "LogPage.cshtml"
+#line 51 "LogPage.cshtml"
;
var messageIndex = 0;
var childIndex = 0;
@@ -186,13 +192,14 @@ WriteTo(__razor_helper_writer, LogRow(new LogInfo()
#line default
#line hidden
-#line 57 "LogPage.cshtml"
+#line 58 "LogPage.cshtml"
WriteTo(__razor_helper_writer, LogRow(node.Messages[messageIndex], level));
#line default
#line hidden
-#line 57 "LogPage.cshtml"
+#line 58 "LogPage.cshtml"
+ counts[node.Messages[messageIndex].Severity.ToString()]++;
messageIndex++;
}
else
@@ -202,13 +209,13 @@ WriteTo(__razor_helper_writer, LogRow(node.Messages[messageIndex], level));
#line default
#line hidden
-#line 62 "LogPage.cshtml"
-WriteTo(__razor_helper_writer, Traverse(node.Children[childIndex], level + 1));
+#line 64 "LogPage.cshtml"
+WriteTo(__razor_helper_writer, Traverse(node.Children[childIndex], level + 1, counts));
#line default
#line hidden
-#line 62 "LogPage.cshtml"
-
+#line 64 "LogPage.cshtml"
+
childIndex++;
}
}
@@ -221,13 +228,14 @@ WriteTo(__razor_helper_writer, Traverse(node.Children[childIndex], level + 1));
#line default
#line hidden
-#line 70 "LogPage.cshtml"
+#line 72 "LogPage.cshtml"
WriteTo(__razor_helper_writer, LogRow(node.Messages[i], level));
#line default
#line hidden
-#line 70 "LogPage.cshtml"
+#line 72 "LogPage.cshtml"
+ counts[node.Messages[i].Severity.ToString()]++;
}
}
else
@@ -239,13 +247,13 @@ WriteTo(__razor_helper_writer, LogRow(node.Messages[i], level));
#line default
#line hidden
-#line 77 "LogPage.cshtml"
-WriteTo(__razor_helper_writer, Traverse(node.Children[i], level + 1));
+#line 80 "LogPage.cshtml"
+WriteTo(__razor_helper_writer, Traverse(node.Children[i], level + 1, counts));
#line default
#line hidden
-#line 77 "LogPage.cshtml"
-
+#line 80 "LogPage.cshtml"
+
}
}
// print end of scope
@@ -254,7 +262,7 @@ WriteTo(__razor_helper_writer, Traverse(node.Children[i], level + 1));
#line default
#line hidden
-#line 81 "LogPage.cshtml"
+#line 84 "LogPage.cshtml"
WriteTo(__razor_helper_writer, LogRow(new LogInfo()
{
Name = node.Name,
@@ -265,7 +273,7 @@ WriteTo(__razor_helper_writer, LogRow(new LogInfo()
#line default
#line hidden
-#line 87 "LogPage.cshtml"
+#line 90 "LogPage.cshtml"
;
#line default
@@ -273,13 +281,13 @@ WriteTo(__razor_helper_writer, LogRow(new LogInfo()
}
);
-#line 88 "LogPage.cshtml"
+#line 91 "LogPage.cshtml"
}
#line default
#line hidden
-#line 10 "LogPage.cshtml"
+#line 11 "LogPage.cshtml"
public LogPage(LogPageModel model)
{
@@ -307,6 +315,7 @@ WriteTo(__razor_helper_writer, LogRow(new LogInfo()
ASP.NET Logs
+
+
+
+ @Resources.ErrorPageHtml_CompilationException
+ @if (Model.Options.ShowExceptionDetails)
+ {
+ @errorDetail.Error.GetType().Name: @{ Output.Write(WebUtility.HtmlEncode(errorDetail.Error.Message).Replace("\r\n", "
").Replace("\r", "
").Replace("\n", "
")); }
+ }
+ else
+ {
+ @Resources.ErrorPageHtml_EnableShowExceptions
+ }
+ @if (Model.Options.ShowExceptionDetails)
+ {
+
+ @{ int tabIndex = 6; }
+
+
+ @foreach (var frame in errorDetail.StackFrames)
+ {
+ -
+ @{ tabIndex++; }
+ @if (!string.IsNullOrEmpty(frame.ErrorDetails))
+ {
+
@frame.ErrorDetails
+ }
+ else
+ {
+ if (string.IsNullOrEmpty(frame.File))
+ {
+ @frame.Function
+ }
+ else
+ {
+ @frame.Function in @System.IO.Path.GetFileName(frame.File)
+ }
+ }
+ @if (frame.Line != 0 && frame.ContextCode.Any())
+ {
+
+ @if (frame.PreContextCode != null)
+ {
+
+ @foreach (var line in frame.PreContextCode)
+ {
+ - @line
+ }
+
+ }
+
+ @foreach (var line in frame.ContextCode)
+ {
+ - @line
+ }
+
+ @if (frame.PostContextCode != null)
+ {
+
+ @foreach (var line in frame.PostContextCode)
+ {
+ - @line
+ }
+
+ }
+
+ }
+
+ }
+
+
+ }
+
+
+
diff --git a/src/Microsoft.AspNet.Diagnostics/Views/ErrorPage.cs b/src/Microsoft.AspNet.Diagnostics/Views/ErrorPage.cs
index a2826d6d32..ecb486deae 100644
--- a/src/Microsoft.AspNet.Diagnostics/Views/ErrorPage.cs
+++ b/src/Microsoft.AspNet.Diagnostics/Views/ErrorPage.cs
@@ -472,7 +472,7 @@ using Views
#line hidden
#line 123 "ErrorPage.cshtml"
- if (frame.Line != 0 && frame.ContextCode != null)
+ if (frame.Line != 0 && frame.ContextCode.Any())
{
#line default
@@ -493,8 +493,8 @@ using Views
#line hidden
WriteLiteral(" (frame.PreContextLine, 5285), false));
+ WriteAttribute("start", Tuple.Create(" start=\"", 5275), Tuple.Create("\"", 5304),
+ Tuple.Create(Tuple.Create("", 5283), Tuple.Create(frame.PreContextLine, 5283), false));
WriteLiteral(" class=\"collapsible\">\r\n");
#line 129 "ErrorPage.cshtml"
@@ -530,22 +530,43 @@ using Views
#line hidden
WriteLiteral("\r\n (frame.Line, 5782), false));
- WriteLiteral(" class=\"highlight\">\r\n - ");
+ WriteAttribute("start", Tuple.Create(" start=\"", 5772), Tuple.Create("\"", 5791),
+ Tuple.Create(Tuple.Create("", 5780), Tuple.Create(frame.Line, 5780), false));
+ WriteLiteral(" class=\"highlight\">\r\n");
#line 137 "ErrorPage.cshtml"
- Write(frame.ContextCode);
+
#line default
#line hidden
- WriteLiteral("
\r\n\r\n");
+
+#line 137 "ErrorPage.cshtml"
+ foreach (var line in frame.ContextCode)
+ {
+
+#line default
+#line hidden
+
+ WriteLiteral(" - ");
#line 139 "ErrorPage.cshtml"
+ Write(line);
+
+#line default
+#line hidden
+ WriteLiteral("
\r\n");
+#line 140 "ErrorPage.cshtml"
+ }
+
+#line default
+#line hidden
+
+ WriteLiteral("
\r\n\r\n");
+#line 143 "ErrorPage.cshtml"
#line default
#line hidden
-#line 139 "ErrorPage.cshtml"
+#line 143 "ErrorPage.cshtml"
if (frame.PostContextCode != null)
{
@@ -553,16 +574,16 @@ using Views
#line hidden
WriteLiteral(" (frame.Line + 1, 6099), false));
+ WriteAttribute("start", Tuple.Create(" start=\'", 6318), Tuple.Create("\'", 6343),
+ Tuple.Create(Tuple.Create("", 6326), Tuple.Create(frame.Line + 1, 6326), false));
WriteLiteral(" class=\"collapsible\">\r\n");
-#line 142 "ErrorPage.cshtml"
+#line 146 "ErrorPage.cshtml"
#line default
#line hidden
-#line 142 "ErrorPage.cshtml"
+#line 146 "ErrorPage.cshtml"
foreach (var line in frame.PostContextCode)
{
@@ -570,55 +591,55 @@ using Views
#line hidden
WriteLiteral(" - ");
-#line 144 "ErrorPage.cshtml"
+#line 148 "ErrorPage.cshtml"
Write(line);
#line default
#line hidden
WriteLiteral("
\r\n");
-#line 145 "ErrorPage.cshtml"
+#line 149 "ErrorPage.cshtml"
}
#line default
#line hidden
WriteLiteral("
\r\n");
-#line 147 "ErrorPage.cshtml"
+#line 151 "ErrorPage.cshtml"
}
#line default
#line hidden
WriteLiteral(" \r\n");
-#line 149 "ErrorPage.cshtml"
+#line 153 "ErrorPage.cshtml"
}
#line default
#line hidden
WriteLiteral(" \r\n");
-#line 151 "ErrorPage.cshtml"
+#line 155 "ErrorPage.cshtml"
}
#line default
#line hidden
WriteLiteral(" \r\n \r\n");
-#line 154 "ErrorPage.cshtml"
+#line 158 "ErrorPage.cshtml"
}
#line default
#line hidden
WriteLiteral(" \r\n \r\n");
-#line 157 "ErrorPage.cshtml"
+#line 161 "ErrorPage.cshtml"
}
#line default
#line hidden
WriteLiteral(" ");
-#line 158 "ErrorPage.cshtml"
+#line 162 "ErrorPage.cshtml"
if (Model.Options.ShowQuery)
{
@@ -626,13 +647,13 @@ using Views
#line hidden
WriteLiteral(" \r\n");
-#line 161 "ErrorPage.cshtml"
+#line 165 "ErrorPage.cshtml"
#line default
#line hidden
-#line 161 "ErrorPage.cshtml"
+#line 165 "ErrorPage.cshtml"
if (Model.Query.Any())
{
@@ -641,26 +662,26 @@ using Views
WriteLiteral("
\r\n \r\n " +
" \r\n | ");
-#line 166 "ErrorPage.cshtml"
+#line 170 "ErrorPage.cshtml"
Write(Resources.ErrorPageHtml_VariableColumn);
#line default
#line hidden
WriteLiteral(" | \r\n ");
-#line 167 "ErrorPage.cshtml"
+#line 171 "ErrorPage.cshtml"
Write(Resources.ErrorPageHtml_ValueColumn);
#line default
#line hidden
WriteLiteral(" | \r\n
\r\n \r\n " +
" \r\n");
-#line 171 "ErrorPage.cshtml"
+#line 175 "ErrorPage.cshtml"
#line default
#line hidden
-#line 171 "ErrorPage.cshtml"
+#line 175 "ErrorPage.cshtml"
foreach (var kv in Model.Query.OrderBy(kv => kv.Key))
{
foreach (var v in kv.Value)
@@ -671,19 +692,19 @@ using Views
WriteLiteral(" \r\n " +
" | ");
-#line 176 "ErrorPage.cshtml"
+#line 180 "ErrorPage.cshtml"
Write(kv.Key);
#line default
#line hidden
WriteLiteral(" | \r\n ");
-#line 177 "ErrorPage.cshtml"
+#line 181 "ErrorPage.cshtml"
Write(v);
#line default
#line hidden
WriteLiteral(" | \r\n
\r\n");
-#line 179 "ErrorPage.cshtml"
+#line 183 "ErrorPage.cshtml"
}
}
@@ -691,7 +712,7 @@ using Views
#line hidden
WriteLiteral(" \r\n
\r\n");
-#line 183 "ErrorPage.cshtml"
+#line 187 "ErrorPage.cshtml"
}
else
{
@@ -700,27 +721,27 @@ using Views
#line hidden
WriteLiteral("
");
-#line 186 "ErrorPage.cshtml"
+#line 190 "ErrorPage.cshtml"
Write(Resources.ErrorPageHtml_NoQueryStringData);
#line default
#line hidden
WriteLiteral("
\r\n");
-#line 187 "ErrorPage.cshtml"
+#line 191 "ErrorPage.cshtml"
}
#line default
#line hidden
WriteLiteral("
\r\n");
-#line 189 "ErrorPage.cshtml"
+#line 193 "ErrorPage.cshtml"
}
#line default
#line hidden
WriteLiteral(" ");
-#line 190 "ErrorPage.cshtml"
+#line 194 "ErrorPage.cshtml"
if (Model.Options.ShowCookies)
{
/* TODO:
@@ -757,7 +778,7 @@ using Views
#line hidden
WriteLiteral(" ");
-#line 221 "ErrorPage.cshtml"
+#line 225 "ErrorPage.cshtml"
if (Model.Options.ShowHeaders)
{
@@ -765,13 +786,13 @@ using Views
#line hidden
WriteLiteral(" \r\n");
-#line 252 "ErrorPage.cshtml"
+#line 256 "ErrorPage.cshtml"
}
#line default
#line hidden
WriteLiteral(" ");
-#line 253 "ErrorPage.cshtml"
+#line 257 "ErrorPage.cshtml"
if (Model.Options.ShowEnvironment)
{
/* TODO:
diff --git a/src/Microsoft.AspNet.Diagnostics/Views/ErrorPage.cshtml b/src/Microsoft.AspNet.Diagnostics/Views/ErrorPage.cshtml
index de7abfad3c..7a0075ac42 100644
--- a/src/Microsoft.AspNet.Diagnostics/Views/ErrorPage.cshtml
+++ b/src/Microsoft.AspNet.Diagnostics/Views/ErrorPage.cshtml
@@ -120,7 +120,7 @@
@frame.Function in @System.IO.Path.GetFileName(frame.File)
}
- @if (frame.Line != 0 && frame.ContextCode != null)
+ @if (frame.Line != 0 && frame.ContextCode.Any())
{
@if (frame.PreContextCode != null)
@@ -134,7 +134,11 @@
}
- - @frame.ContextCode
+ @foreach (var line in frame.ContextCode)
+ {
+
@line
+ }
+
@if (frame.PostContextCode != null)
{
diff --git a/src/Microsoft.AspNet.Diagnostics/Views/StackFrame.cs b/src/Microsoft.AspNet.Diagnostics/Views/StackFrame.cs
index 2b17068868..4a1ec2f513 100644
--- a/src/Microsoft.AspNet.Diagnostics/Views/StackFrame.cs
+++ b/src/Microsoft.AspNet.Diagnostics/Views/StackFrame.cs
@@ -39,11 +39,16 @@ namespace Microsoft.AspNet.Diagnostics.Views
///
///
///
- public string ContextCode { get; set; }
+ public IEnumerable
ContextCode { get; set; }
///
///
///
public IEnumerable PostContextCode { get; set; }
+
+ ///
+ /// Specific error details for this stack frame.
+ ///
+ public string ErrorDetails { get; set; }
}
}
diff --git a/src/Microsoft.AspNet.Diagnostics/project.json b/src/Microsoft.AspNet.Diagnostics/project.json
index c45eb89a56..d180b2787a 100644
--- a/src/Microsoft.AspNet.Diagnostics/project.json
+++ b/src/Microsoft.AspNet.Diagnostics/project.json
@@ -2,7 +2,6 @@
"version": "1.0.0-*",
"description": "ASP.NET 5 Middleware for error handling, error pages, and diagnostics information.",
"dependencies": {
- "Microsoft.AspNet.PipelineCore": "1.0.0-*",
"Microsoft.AspNet.RequestContainer": "1.0.0-*",
"Microsoft.Framework.Runtime.Interfaces": { "version": "1.0.0-*", "type": "build" }
},
diff --git a/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/DatabaseErrorPageMiddlewareTest.cs b/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/DatabaseErrorPageMiddlewareTest.cs
index 61516a7a97..4ff4d60d3d 100644
--- a/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/DatabaseErrorPageMiddlewareTest.cs
+++ b/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/DatabaseErrorPageMiddlewareTest.cs
@@ -14,8 +14,8 @@ using Microsoft.AspNet.Http;
using Microsoft.AspNet.TestHost;
using Microsoft.Data.Entity;
using Microsoft.Data.Entity.Infrastructure;
-using Microsoft.Data.Entity.Migrations;
-using Microsoft.Data.Entity.Migrations.Infrastructure;
+using Microsoft.Data.Entity.Relational.Migrations;
+using Microsoft.Data.Entity.Relational.Migrations.Infrastructure;
using Microsoft.Data.Entity.Utilities;
using Microsoft.Framework.DependencyInjection;
using Microsoft.Framework.Logging;
@@ -235,7 +235,10 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests
{
services.AddEntityFramework().AddSqlServer();
services.AddScoped();
- services.AddInstance(new DbContextOptions().UseSqlServer(database.ConnectionString));
+
+ var contextOptions = new DbContextOptions();
+ contextOptions.UseSqlServer(database.ConnectionString);
+ services.AddInstance(contextOptions);
});
var options = DatabaseErrorPageOptions.ShowAll;
@@ -268,9 +271,10 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests
services.AddEntityFramework()
.AddSqlServer();
- services.AddInstance(
- new DbContextOptions()
- .UseSqlServer(database.ConnectionString));
+ var options = new DbContextOptions();
+ options.UseSqlServer(database.ConnectionString);
+
+ services.AddInstance(options);
});
app.UseDatabaseErrorPage();
@@ -338,6 +342,41 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests
}
}
+ [Fact]
+ public async Task Error_page_displayed_when_exception_wrapped()
+ {
+ TestServer server = SetupTestServer();
+ HttpResponseMessage response = await server.CreateClient().GetAsync("http://localhost/");
+
+ Assert.Equal(HttpStatusCode.InternalServerError, response.StatusCode);
+ var content = await response.Content.ReadAsStringAsync();
+ Assert.Contains("I wrapped your exception", content);
+ Assert.Contains(StringsHelpers.GetResourceString("FormatDatabaseErrorPage_NoDbOrMigrationsTitle", typeof(BloggingContext).Name), content);
+ }
+
+ class WrappedExceptionMiddleware
+ {
+ public WrappedExceptionMiddleware(RequestDelegate next)
+ { }
+
+ public virtual Task Invoke(HttpContext context)
+ {
+ using (var db = context.ApplicationServices.GetService())
+ {
+ db.Blogs.Add(new Blog());
+ try
+ {
+ db.SaveChanges();
+ throw new Exception("SaveChanges should have thrown");
+ }
+ catch (Exception ex)
+ {
+ throw new Exception("I wrapped your exception", ex);
+ }
+ }
+ }
+ }
+
private static TestServer SetupTestServer(ILoggerProvider logProvider = null)
where TContext : DbContext
{
@@ -351,9 +390,11 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests
.AddSqlServer();
services.AddScoped();
- services.AddInstance(
- new DbContextOptions()
- .UseSqlServer(database.ConnectionString));
+
+ var options = new DbContextOptions();
+ options.UseSqlServer(database.ConnectionString);
+
+ services.AddInstance(options);
});
app.UseDatabaseErrorPage();
diff --git a/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/MigrationsEndPointMiddlewareTest.cs b/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/MigrationsEndPointMiddlewareTest.cs
index 66fa99abc7..73db458229 100644
--- a/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/MigrationsEndPointMiddlewareTest.cs
+++ b/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/MigrationsEndPointMiddlewareTest.cs
@@ -12,9 +12,9 @@ using Microsoft.AspNet.Http;
using Microsoft.AspNet.TestHost;
using Microsoft.Data.Entity;
using Microsoft.Data.Entity.Infrastructure;
-using Microsoft.Data.Entity.Migrations;
-using Microsoft.Data.Entity.Migrations.Infrastructure;
-using Microsoft.Data.Entity.Migrations.Utilities;
+using Microsoft.Data.Entity.Relational.Migrations;
+using Microsoft.Data.Entity.Relational.Migrations.Infrastructure;
+using Microsoft.Data.Entity.Relational.Migrations.Utilities;
using Microsoft.Data.Entity.Utilities;
using Microsoft.Framework.DependencyInjection;
using Xunit;
@@ -65,7 +65,8 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests
{
using (var database = SqlServerTestStore.CreateScratch())
{
- var options = new DbContextOptions().UseSqlServer(database.ConnectionString);
+ var options = new DbContextOptions();
+ options.UseSqlServer(database.ConnectionString);
var path = useCustomPath ? new PathString("/EndPoints/ApplyMyMigrations") : MigrationsEndPointOptions.DefaultPath;
TestServer server = TestServer.Create(app =>
@@ -183,7 +184,8 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests
{
using (var database = SqlServerTestStore.CreateScratch())
{
- var options = new DbContextOptions().UseSqlServer(database.ConnectionString);
+ var options = new DbContextOptions();
+ options.UseSqlServer(database.ConnectionString);
TestServer server = TestServer.Create(app =>
{
diff --git a/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/SqlServerTestStore.cs b/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/SqlServerTestStore.cs
index d4752ab46f..9082d4b2bb 100644
--- a/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/SqlServerTestStore.cs
+++ b/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/SqlServerTestStore.cs
@@ -40,7 +40,10 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests
private void EnsureDeleted()
{
- using (var db = new DbContext(new DbContextOptions().UseSqlServer(_connectionString)))
+ var options = new DbContextOptions();
+ options.UseSqlServer(_connectionString);
+
+ using (var db = new DbContext(options))
{
db.Database.EnsureDeleted();
}
diff --git a/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/TestModels/BloggingContext.cs b/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/TestModels/BloggingContext.cs
index a8ecc378aa..5a322a7a5e 100644
--- a/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/TestModels/BloggingContext.cs
+++ b/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/TestModels/BloggingContext.cs
@@ -2,7 +2,7 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Microsoft.Data.Entity;
-using Microsoft.Data.Entity.Migrations.Infrastructure;
+using Microsoft.Data.Entity.Relational.Migrations.Infrastructure;
using System;
using System.Linq;
using System.Reflection;
diff --git a/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/TestModels/BloggingContextWithMigrations.cs b/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/TestModels/BloggingContextWithMigrations.cs
index 5d59d57820..d2047fd0f4 100644
--- a/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/TestModels/BloggingContextWithMigrations.cs
+++ b/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/TestModels/BloggingContextWithMigrations.cs
@@ -3,9 +3,9 @@
using Microsoft.Data.Entity;
using Microsoft.Data.Entity.Metadata;
-using Microsoft.Data.Entity.Migrations;
-using Microsoft.Data.Entity.Migrations.Builders;
-using Microsoft.Data.Entity.Migrations.Infrastructure;
+using Microsoft.Data.Entity.Relational.Migrations;
+using Microsoft.Data.Entity.Relational.Migrations.Builders;
+using Microsoft.Data.Entity.Relational.Migrations.Infrastructure;
using System;
using System.Linq;
using System.Reflection;
diff --git a/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/TestModels/BloggingContextWithPendingModelChanges.cs b/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/TestModels/BloggingContextWithPendingModelChanges.cs
index cb98b4bcbf..e571d930ef 100644
--- a/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/TestModels/BloggingContextWithPendingModelChanges.cs
+++ b/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/TestModels/BloggingContextWithPendingModelChanges.cs
@@ -3,9 +3,9 @@
using Microsoft.Data.Entity;
using Microsoft.Data.Entity.Metadata;
-using Microsoft.Data.Entity.Migrations;
-using Microsoft.Data.Entity.Migrations.Builders;
-using Microsoft.Data.Entity.Migrations.Infrastructure;
+using Microsoft.Data.Entity.Relational.Migrations;
+using Microsoft.Data.Entity.Relational.Migrations.Builders;
+using Microsoft.Data.Entity.Relational.Migrations.Infrastructure;
using System;
namespace Microsoft.AspNet.Diagnostics.Entity.Tests
diff --git a/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/TestModels/BloggingContextWithSnapshotThatThrows.cs b/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/TestModels/BloggingContextWithSnapshotThatThrows.cs
index f1c1fd1973..ff2b09354b 100644
--- a/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/TestModels/BloggingContextWithSnapshotThatThrows.cs
+++ b/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/TestModels/BloggingContextWithSnapshotThatThrows.cs
@@ -3,9 +3,9 @@
using Microsoft.Data.Entity;
using Microsoft.Data.Entity.Metadata;
-using Microsoft.Data.Entity.Migrations;
-using Microsoft.Data.Entity.Migrations.Builders;
-using Microsoft.Data.Entity.Migrations.Infrastructure;
+using Microsoft.Data.Entity.Relational.Migrations;
+using Microsoft.Data.Entity.Relational.Migrations.Builders;
+using Microsoft.Data.Entity.Relational.Migrations.Infrastructure;
using System;
using System.Linq;
using System.Reflection;
diff --git a/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/project.json b/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/project.json
index a064bdbca8..7b55cb635e 100644
--- a/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/project.json
+++ b/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/project.json
@@ -4,10 +4,10 @@
"Microsoft.AspNet.Diagnostics.Entity": "7.0.0-*",
"Microsoft.AspNet.Diagnostics.Entity.Tests": "1.0.0",
"Microsoft.AspNet.TestHost": "1.0.0-*",
- "Xunit.KRunner": "1.0.0-*"
+ "xunit.runner.kre": "1.0.0-*"
},
"commands": {
- "test": "Xunit.KRunner"
+ "test": "xunit.runner.kre"
},
"frameworks": {
"aspnet50": { }
diff --git a/test/Microsoft.AspNet.Diagnostics.Entity.Tests/project.json b/test/Microsoft.AspNet.Diagnostics.Entity.Tests/project.json
index 69fa4bca68..bca9f67fd0 100644
--- a/test/Microsoft.AspNet.Diagnostics.Entity.Tests/project.json
+++ b/test/Microsoft.AspNet.Diagnostics.Entity.Tests/project.json
@@ -3,11 +3,11 @@
"EntityFramework.InMemory": "7.0.0-*",
"Microsoft.AspNet.Diagnostics.Entity": "7.0.0-*",
"Moq": "4.2.1312.1622",
- "Xunit.KRunner": "1.0.0-*"
+ "xunit.runner.kre": "1.0.0-*"
},
"code": [ "**\\*.cs", "..\\Shared\\ApiConsistencyTestBase.cs", "..\\Shared\\TestHelpers.cs" ],
"commands": {
- "test": "Xunit.KRunner"
+ "test": "xunit.runner.kre"
},
"frameworks": {
"aspnet50": { }
diff --git a/test/Microsoft.AspNet.Diagnostics.Tests/ElmMiddlewareTest.cs b/test/Microsoft.AspNet.Diagnostics.Tests/ElmMiddlewareTest.cs
index 4e8a298fa7..8343b54910 100644
--- a/test/Microsoft.AspNet.Diagnostics.Tests/ElmMiddlewareTest.cs
+++ b/test/Microsoft.AspNet.Diagnostics.Tests/ElmMiddlewareTest.cs
@@ -155,7 +155,7 @@ namespace Microsoft.AspNet.Diagnostics.Tests
// Assert
contextMock.VerifyGet(c => c.Request.Query, Times.AtLeastOnce());
- Assert.True(response.Contains("Invalid Request Id"));
+ Assert.True(response.Contains("Invalid Id"));
}
}
@@ -205,8 +205,8 @@ namespace Microsoft.AspNet.Diagnostics.Tests
.SetupGet(c => c.Request.Cookies)
.Returns(new Mock().Object);
contextMock
- .Setup(c => c.Request.GetFormAsync(It.IsAny()))
- .Returns(Task.FromResult(new Mock().Object));
+ .Setup(c => c.Request.ReadFormAsync(It.IsAny()))
+ .Returns(Task.FromResult(new Mock().Object));
return contextMock;
}
diff --git a/test/Microsoft.AspNet.Diagnostics.Tests/project.json b/test/Microsoft.AspNet.Diagnostics.Tests/project.json
index 31e676c054..8d43ffb74b 100644
--- a/test/Microsoft.AspNet.Diagnostics.Tests/project.json
+++ b/test/Microsoft.AspNet.Diagnostics.Tests/project.json
@@ -4,7 +4,7 @@
},
"dependencies": {
"Microsoft.AspNet.Diagnostics.Elm": "1.0.0-*",
- "Xunit.KRunner": "1.0.0-*"
+ "xunit.runner.kre": "1.0.0-*"
},
"frameworks": {
@@ -17,6 +17,6 @@
}
},
"commands": {
- "test": "Xunit.KRunner"
+ "test": "xunit.runner.kre"
}
}