From e28b328186d23fe24e9e661311a899c7d86e0ba3 Mon Sep 17 00:00:00 2001 From: suhasj Date: Wed, 25 Mar 2015 11:46:14 -0700 Subject: [PATCH 01/15] Updating to release NuGet.config --- NuGet.Config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NuGet.Config b/NuGet.Config index da57d47267..1978dc065a 100644 --- a/NuGet.Config +++ b/NuGet.Config @@ -1,7 +1,7 @@  - + - \ No newline at end of file + From 9cffbd171b3f1fdd61de251685984c885e5efadb Mon Sep 17 00:00:00 2001 From: Kiran Challa Date: Wed, 25 Mar 2015 15:59:30 -0700 Subject: [PATCH 02/15] Fix Elm extensions --- .../ElmServiceCollectionExtensions.cs | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/Microsoft.AspNet.Diagnostics.Elm/ElmServiceCollectionExtensions.cs b/src/Microsoft.AspNet.Diagnostics.Elm/ElmServiceCollectionExtensions.cs index 7e4c9fb92c..34f0af3991 100644 --- a/src/Microsoft.AspNet.Diagnostics.Elm/ElmServiceCollectionExtensions.cs +++ b/src/Microsoft.AspNet.Diagnostics.Elm/ElmServiceCollectionExtensions.cs @@ -10,26 +10,25 @@ namespace Microsoft.Framework.DependencyInjection public static class ElmServiceCollectionExtensions { /// - /// Registers an and configures . + /// Registers an and configures default . /// public static IServiceCollection AddElm([NotNull] this IServiceCollection services) { - return services.AddElm(configureOptions: null); + services.AddOptions(); + services.AddSingleton(); + return services; } /// - /// Registers an and configures . + /// Configures a set of for the application. /// - public static IServiceCollection AddElm([NotNull] this IServiceCollection services, Action configureOptions) + /// The services available in the application. + /// The which need to be configured. + public static void ConfigureElm( + [NotNull] this IServiceCollection services, + [NotNull] Action configureOptions) { - services.AddSingleton(); // registering the service so it can be injected into constructors - - if (configureOptions != null) - { - services.Configure(configureOptions); - } - - return services; + services.Configure(configureOptions); } } } \ No newline at end of file From ebda837e35c8aeaed2eb31caf25f7168e4a76e24 Mon Sep 17 00:00:00 2001 From: Brice Lambson Date: Mon, 30 Mar 2015 09:13:23 -0700 Subject: [PATCH 03/15] React to Migrations API changes --- .../TestModels/BloggingContextWithMigrations.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/TestModels/BloggingContextWithMigrations.cs b/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/TestModels/BloggingContextWithMigrations.cs index 9993c53850..ec1091e087 100644 --- a/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/TestModels/BloggingContextWithMigrations.cs +++ b/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/TestModels/BloggingContextWithMigrations.cs @@ -73,10 +73,10 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests migrationBuilder.CreateTable("Blog", c => new { - BlogId = c.Column("int", annotations: new Dictionary { { "SqlServer:ValueGeneration", "Identity" } }), + BlogId = c.Column("int").Annotation("SqlServer:ValueGeneration", "Identity"), Name = c.Column("nvarchar(max)", nullable: true), }) - .PrimaryKey(t => t.BlogId, name: "PK_Blog"); + .PrimaryKey("PK_Blog", t => t.BlogId); } public override void Down(MigrationBuilder migrationBuilder) From cfb20ff33c71c850bed70fc7c5d723ab1ee49599 Mon Sep 17 00:00:00 2001 From: "N. Taylor Mullen" Date: Wed, 1 Apr 2015 15:42:06 -0700 Subject: [PATCH 04/15] Add travis and appveyor CI support. --- .travis.yml | 3 +++ appveyor.yml | 5 +++++ build.sh | 0 test/Microsoft.AspNet.Diagnostics.Tests/project.json | 2 +- 4 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 .travis.yml create mode 100644 appveyor.yml mode change 100644 => 100755 build.sh diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000000..0f4cb93e59 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,3 @@ +language: csharp +script: + - ./build.sh verify \ No newline at end of file diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000000..88cb9ef145 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,5 @@ +build_script: + - build.cmd verify +clone_depth: 1 +test: off +deploy: off \ No newline at end of file diff --git a/build.sh b/build.sh old mode 100644 new mode 100755 diff --git a/test/Microsoft.AspNet.Diagnostics.Tests/project.json b/test/Microsoft.AspNet.Diagnostics.Tests/project.json index 6101f63dc2..581b92d041 100644 --- a/test/Microsoft.AspNet.Diagnostics.Tests/project.json +++ b/test/Microsoft.AspNet.Diagnostics.Tests/project.json @@ -1,6 +1,6 @@ { "compilationOptions": { - "warningsAsErrors": true + "warningsAsErrors": "true" }, "dependencies": { "Microsoft.AspNet.Diagnostics.Elm": "1.0.0-*", From 67872e2312cb053a34499f523c9d2ca73f07fa3f Mon Sep 17 00:00:00 2001 From: "N. Taylor Mullen" Date: Wed, 1 Apr 2015 17:04:57 -0700 Subject: [PATCH 05/15] Turn off sudo for .travis.yml. --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 0f4cb93e59..5939a529e5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,4 @@ language: csharp +sudo: false script: - ./build.sh verify \ No newline at end of file From 36d155ab96f701e98f4b166e20295e1251b84505 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Wed, 1 Apr 2015 18:13:45 -0700 Subject: [PATCH 06/15] Adding status badges --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 7d8c5d8a51..429b4fce30 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ ASP.NET DiagnosticsPages ================ +AppVeyor: [![AppVeyor](https://ci.appveyor.com/api/projects/status/5224cefq6y78aq21/branch/dev?svg=true)](https://ci.appveyor.com/project/aspnetci/Diagnostics/branch/dev) + +Travis: [![Travis](https://travis-ci.org/aspnet/Diagnostics.svg?branch=dev)](https://travis-ci.org/aspnet/Diagnostics) Diagnostics middleware. From e43ae88e57ca08a11b43e67772cb8dd9ff992420 Mon Sep 17 00:00:00 2001 From: Troy Dai Date: Thu, 2 Apr 2015 09:19:58 -0700 Subject: [PATCH 07/15] Update global.json, sources=>projects --- global.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/global.json b/global.json index 840c36f6ad..983ba0401e 100644 --- a/global.json +++ b/global.json @@ -1,3 +1,3 @@ { - "sources": ["src"] -} \ No newline at end of file + "projects": ["src"] +} From d2dfae108ab69803a0825e543aaffff0e98ddd5f Mon Sep 17 00:00:00 2001 From: Pranav K Date: Thu, 2 Apr 2015 12:10:52 -0700 Subject: [PATCH 08/15] * Remove ICompilation* interfaces from Diagnostics * Removing error message from CompilationErrorPage since it repeats individual errors. Fixes #111 --- .../Compilation/ICompilationException.cs | 18 -- .../Compilation/ICompilationFailure.cs | 38 ----- .../Compilation/ICompilationMessage.cs | 37 ----- .../ErrorPageMiddleware.cs | 1 + .../Views/CompilationErrorPage.cs | 156 +++++++++--------- .../Views/CompilationErrorPage.cshtml | 13 +- 6 files changed, 91 insertions(+), 172 deletions(-) delete mode 100644 src/Microsoft.AspNet.Diagnostics.Interfaces/Compilation/ICompilationException.cs delete mode 100644 src/Microsoft.AspNet.Diagnostics.Interfaces/Compilation/ICompilationFailure.cs delete mode 100644 src/Microsoft.AspNet.Diagnostics.Interfaces/Compilation/ICompilationMessage.cs diff --git a/src/Microsoft.AspNet.Diagnostics.Interfaces/Compilation/ICompilationException.cs b/src/Microsoft.AspNet.Diagnostics.Interfaces/Compilation/ICompilationException.cs deleted file mode 100644 index 31e9a01347..0000000000 --- a/src/Microsoft.AspNet.Diagnostics.Interfaces/Compilation/ICompilationException.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.Collections.Generic; - -namespace Microsoft.AspNet.Diagnostics -{ - /// - /// Specifies the contract for an exception representing compilation failure. - /// - public interface ICompilationException - { - /// - /// Gets a sequence of with compilation failures. - /// - IEnumerable CompilationFailures { get; } - } -} \ No newline at end of file diff --git a/src/Microsoft.AspNet.Diagnostics.Interfaces/Compilation/ICompilationFailure.cs b/src/Microsoft.AspNet.Diagnostics.Interfaces/Compilation/ICompilationFailure.cs deleted file mode 100644 index ede7bcd270..0000000000 --- a/src/Microsoft.AspNet.Diagnostics.Interfaces/Compilation/ICompilationFailure.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.Collections.Generic; - -namespace Microsoft.AspNet.Diagnostics -{ - /// - /// Specifies the contract for a file that fails compilation. - /// - public interface ICompilationFailure - { - /// - /// Path of the file that produced the compilation exception. - /// - string SourceFilePath { get; } - - /// - /// Contents of the file. - /// - string SourceFileContent { get; } - - /// - /// Contents being compiled. - /// - /// - /// For templated files, the represents the original content and - /// represents the transformed content. This property can be null if - /// the exception is encountered during transformation. - /// - string CompiledContent { get; } - - /// - /// Gets a sequence of produced as a result of compilation. - /// - IEnumerable Messages { get; } - } -} \ No newline at end of file diff --git a/src/Microsoft.AspNet.Diagnostics.Interfaces/Compilation/ICompilationMessage.cs b/src/Microsoft.AspNet.Diagnostics.Interfaces/Compilation/ICompilationMessage.cs deleted file mode 100644 index 237dcd2332..0000000000 --- a/src/Microsoft.AspNet.Diagnostics.Interfaces/Compilation/ICompilationMessage.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -namespace Microsoft.AspNet.Diagnostics -{ - /// - /// Specifies the contract for diagnostic messages produced as result of compiling an instance - /// of . - /// - public interface ICompilationMessage - { - /// - /// Gets the error message. - /// - string Message { get; } - - /// - /// Gets the zero-based line index for the start of the compilation error. - /// - int StartLine { get; } - - /// - /// Gets the zero-based column index for the start of the compilation error. - /// - int StartColumn { get; } - - /// - /// Gets the zero-based line index for the end of the compilation error. - /// - int EndLine { get; } - - /// - /// Gets the zero-based column index for the end of the compilation error. - /// - int EndColumn { get; } - } -} \ No newline at end of file diff --git a/src/Microsoft.AspNet.Diagnostics/ErrorPageMiddleware.cs b/src/Microsoft.AspNet.Diagnostics/ErrorPageMiddleware.cs index aa8851bcc0..fccbf7b42c 100644 --- a/src/Microsoft.AspNet.Diagnostics/ErrorPageMiddleware.cs +++ b/src/Microsoft.AspNet.Diagnostics/ErrorPageMiddleware.cs @@ -12,6 +12,7 @@ using System.Threading.Tasks; using Microsoft.AspNet.Builder; using Microsoft.AspNet.Diagnostics.Views; using Microsoft.AspNet.Http; +using Microsoft.Framework.Runtime; namespace Microsoft.AspNet.Diagnostics { diff --git a/src/Microsoft.AspNet.Diagnostics/Views/CompilationErrorPage.cs b/src/Microsoft.AspNet.Diagnostics/Views/CompilationErrorPage.cs index 6649e04287..4211cd3fc6 100644 --- a/src/Microsoft.AspNet.Diagnostics/Views/CompilationErrorPage.cs +++ b/src/Microsoft.AspNet.Diagnostics/Views/CompilationErrorPage.cs @@ -81,49 +81,27 @@ using Views #line hidden #line 28 "CompilationErrorPage.cshtml" - if (Model.Options.ShowExceptionDetails) - { - -#line default -#line hidden - - WriteLiteral("
"); -#line 30 "CompilationErrorPage.cshtml" - Write(errorDetail.Error.GetType().Name); - -#line default -#line hidden - WriteLiteral(": "); -#line 30 "CompilationErrorPage.cshtml" - Output.Write(HtmlEncodeAndReplaceLineBreaks(errorDetail.Error.Message)); - -#line default -#line hidden - - WriteLiteral("
\r\n"); -#line 31 "CompilationErrorPage.cshtml" - } - else + if (!Model.Options.ShowExceptionDetails) { #line default #line hidden WriteLiteral("

"); -#line 34 "CompilationErrorPage.cshtml" +#line 30 "CompilationErrorPage.cshtml" Write(Resources.ErrorPageHtml_EnableShowExceptions); #line default #line hidden WriteLiteral("

\r\n"); -#line 35 "CompilationErrorPage.cshtml" +#line 31 "CompilationErrorPage.cshtml" } #line default #line hidden WriteLiteral(" "); -#line 36 "CompilationErrorPage.cshtml" +#line 32 "CompilationErrorPage.cshtml" if (Model.Options.ShowExceptionDetails) { @@ -131,26 +109,56 @@ using Views #line hidden WriteLiteral("
\r\n"); -#line 39 "CompilationErrorPage.cshtml" +#line 35 "CompilationErrorPage.cshtml" #line default #line hidden -#line 39 "CompilationErrorPage.cshtml" +#line 35 "CompilationErrorPage.cshtml" int tabIndex = 6; #line default #line hidden - WriteLiteral("\r\n
\r\n
    \r\n"); -#line 42 "CompilationErrorPage.cshtml" + WriteLiteral("\r\n"); +#line 36 "CompilationErrorPage.cshtml" #line default #line hidden -#line 42 "CompilationErrorPage.cshtml" +#line 36 "CompilationErrorPage.cshtml" + + var fileName = errorDetail.StackFrames.FirstOrDefault()?.File; + if (!string.IsNullOrEmpty(fileName)) + { + +#line default +#line hidden + + WriteLiteral("
    "); +#line 40 "CompilationErrorPage.cshtml" + Write(fileName); + +#line default +#line hidden + WriteLiteral("
    \r\n"); +#line 41 "CompilationErrorPage.cshtml" + } + + +#line default +#line hidden + + WriteLiteral("\r\n
    \r\n
      \r\n"); +#line 45 "CompilationErrorPage.cshtml" + + +#line default +#line hidden + +#line 45 "CompilationErrorPage.cshtml" foreach (var frame in errorDetail.StackFrames) { @@ -158,29 +166,29 @@ using Views #line hidden WriteLiteral("
    • (tabIndex, 1319), false)); + WriteAttribute("tabindex", Tuple.Create(" tabindex=\"", 1409), Tuple.Create("\"", 1429), + Tuple.Create(Tuple.Create("", 1420), Tuple.Create(tabIndex, 1420), false)); WriteLiteral(">\r\n"); -#line 45 "CompilationErrorPage.cshtml" +#line 48 "CompilationErrorPage.cshtml" #line default #line hidden -#line 45 "CompilationErrorPage.cshtml" +#line 48 "CompilationErrorPage.cshtml" tabIndex++; #line default #line hidden WriteLiteral("\r\n"); -#line 46 "CompilationErrorPage.cshtml" +#line 49 "CompilationErrorPage.cshtml" #line default #line hidden -#line 46 "CompilationErrorPage.cshtml" +#line 49 "CompilationErrorPage.cshtml" if (!string.IsNullOrEmpty(frame.ErrorDetails)) { @@ -188,13 +196,13 @@ using Views #line hidden WriteLiteral("

      "); -#line 48 "CompilationErrorPage.cshtml" +#line 51 "CompilationErrorPage.cshtml" Write(frame.ErrorDetails); #line default #line hidden WriteLiteral("

      \r\n"); -#line 49 "CompilationErrorPage.cshtml" +#line 52 "CompilationErrorPage.cshtml" } else { @@ -205,13 +213,13 @@ using Views #line hidden WriteLiteral("

      "); -#line 54 "CompilationErrorPage.cshtml" +#line 57 "CompilationErrorPage.cshtml" Write(frame.Function); #line default #line hidden WriteLiteral("

      \r\n"); -#line 55 "CompilationErrorPage.cshtml" +#line 58 "CompilationErrorPage.cshtml" } else { @@ -220,22 +228,22 @@ using Views #line hidden WriteLiteral("

      "); -#line 58 "CompilationErrorPage.cshtml" +#line 61 "CompilationErrorPage.cshtml" Write(frame.Function); #line default #line hidden WriteLiteral(" in (frame.File, 1936), false)); + WriteAttribute("title", Tuple.Create(" title=\"", 2029), Tuple.Create("\"", 2048), + Tuple.Create(Tuple.Create("", 2037), Tuple.Create(frame.File, 2037), false)); WriteLiteral(">"); -#line 58 "CompilationErrorPage.cshtml" +#line 61 "CompilationErrorPage.cshtml" Write(System.IO.Path.GetFileName(frame.File)); #line default #line hidden WriteLiteral("

      \r\n"); -#line 59 "CompilationErrorPage.cshtml" +#line 62 "CompilationErrorPage.cshtml" } } @@ -243,7 +251,7 @@ using Views #line hidden WriteLiteral(" "); -#line 61 "CompilationErrorPage.cshtml" +#line 64 "CompilationErrorPage.cshtml" if (frame.Line != 0 && frame.ContextCode.Any()) { @@ -251,13 +259,13 @@ using Views #line hidden WriteLiteral("
      \r\n"); -#line 64 "CompilationErrorPage.cshtml" +#line 67 "CompilationErrorPage.cshtml" #line default #line hidden -#line 64 "CompilationErrorPage.cshtml" +#line 67 "CompilationErrorPage.cshtml" if (frame.PreContextCode != null) { @@ -265,16 +273,16 @@ using Views #line hidden WriteLiteral(" (frame.PreContextLine, 2361), false)); + WriteAttribute("start", Tuple.Create(" start=\"", 2454), Tuple.Create("\"", 2483), + Tuple.Create(Tuple.Create("", 2462), Tuple.Create(frame.PreContextLine, 2462), false)); WriteLiteral(" class=\"collapsible\">\r\n"); -#line 67 "CompilationErrorPage.cshtml" +#line 70 "CompilationErrorPage.cshtml" #line default #line hidden -#line 67 "CompilationErrorPage.cshtml" +#line 70 "CompilationErrorPage.cshtml" foreach (var line in frame.PreContextCode) { @@ -282,36 +290,36 @@ using Views #line hidden WriteLiteral("
    • "); -#line 69 "CompilationErrorPage.cshtml" +#line 72 "CompilationErrorPage.cshtml" Write(line); #line default #line hidden WriteLiteral("
    • \r\n"); -#line 70 "CompilationErrorPage.cshtml" +#line 73 "CompilationErrorPage.cshtml" } #line default #line hidden WriteLiteral(" \r\n"); -#line 72 "CompilationErrorPage.cshtml" +#line 75 "CompilationErrorPage.cshtml" } #line default #line hidden WriteLiteral(" (frame.Line, 2771), false)); + WriteAttribute("start", Tuple.Create(" start=\"", 2864), Tuple.Create("\"", 2883), + Tuple.Create(Tuple.Create("", 2872), Tuple.Create(frame.Line, 2872), false)); WriteLiteral(" class=\"highlight\">\r\n"); -#line 74 "CompilationErrorPage.cshtml" +#line 77 "CompilationErrorPage.cshtml" #line default #line hidden -#line 74 "CompilationErrorPage.cshtml" +#line 77 "CompilationErrorPage.cshtml" foreach (var line in frame.ContextCode) { @@ -319,26 +327,26 @@ using Views #line hidden WriteLiteral("
    • "); -#line 76 "CompilationErrorPage.cshtml" +#line 79 "CompilationErrorPage.cshtml" Write(line); #line default #line hidden WriteLiteral("
    • \r\n"); -#line 77 "CompilationErrorPage.cshtml" +#line 80 "CompilationErrorPage.cshtml" } #line default #line hidden WriteLiteral(" \r\n"); -#line 79 "CompilationErrorPage.cshtml" +#line 82 "CompilationErrorPage.cshtml" #line default #line hidden -#line 79 "CompilationErrorPage.cshtml" +#line 82 "CompilationErrorPage.cshtml" if (frame.PostContextCode != null) { @@ -346,16 +354,16 @@ using Views #line hidden WriteLiteral(" (frame.Line + 1, 3219), false)); + WriteAttribute("start", Tuple.Create(" start=\'", 3312), Tuple.Create("\'", 3337), + Tuple.Create(Tuple.Create("", 3320), Tuple.Create(frame.Line + 1, 3320), false)); WriteLiteral(" class=\"collapsible\">\r\n"); -#line 82 "CompilationErrorPage.cshtml" +#line 85 "CompilationErrorPage.cshtml" #line default #line hidden -#line 82 "CompilationErrorPage.cshtml" +#line 85 "CompilationErrorPage.cshtml" foreach (var line in frame.PostContextCode) { @@ -363,41 +371,41 @@ using Views #line hidden WriteLiteral("
    • "); -#line 84 "CompilationErrorPage.cshtml" +#line 87 "CompilationErrorPage.cshtml" Write(line); #line default #line hidden WriteLiteral("
    • \r\n"); -#line 85 "CompilationErrorPage.cshtml" +#line 88 "CompilationErrorPage.cshtml" } #line default #line hidden WriteLiteral(" \r\n"); -#line 87 "CompilationErrorPage.cshtml" +#line 90 "CompilationErrorPage.cshtml" } #line default #line hidden WriteLiteral("
\r\n"); -#line 89 "CompilationErrorPage.cshtml" +#line 92 "CompilationErrorPage.cshtml" } #line default #line hidden WriteLiteral(" \r\n"); -#line 91 "CompilationErrorPage.cshtml" +#line 94 "CompilationErrorPage.cshtml" } #line default #line hidden WriteLiteral(" \r\n \r\n"); -#line 94 "CompilationErrorPage.cshtml" +#line 97 "CompilationErrorPage.cshtml" } #line default diff --git a/src/Microsoft.AspNet.Diagnostics/Views/CompilationErrorPage.cshtml b/src/Microsoft.AspNet.Diagnostics/Views/CompilationErrorPage.cshtml index 619778b097..b07612f535 100644 --- a/src/Microsoft.AspNet.Diagnostics/Views/CompilationErrorPage.cshtml +++ b/src/Microsoft.AspNet.Diagnostics/Views/CompilationErrorPage.cshtml @@ -25,11 +25,7 @@

@Resources.ErrorPageHtml_CompilationException

- @if (Model.Options.ShowExceptionDetails) - { -
@errorDetail.Error.GetType().Name: @{ Output.Write(HtmlEncodeAndReplaceLineBreaks(errorDetail.Error.Message)); }
- } - else + @if (!Model.Options.ShowExceptionDetails) {

@Resources.ErrorPageHtml_EnableShowExceptions

} @@ -37,6 +33,13 @@ {
@{ int tabIndex = 6; } + @{ + var fileName = errorDetail.StackFrames.FirstOrDefault()?.File; + if (!string.IsNullOrEmpty(fileName)) + { +
@fileName
+ } + }
    @foreach (var frame in errorDetail.StackFrames) From 9d095e2f210951cbdd448bcc59083813d4365ac5 Mon Sep 17 00:00:00 2001 From: Doug Bunting Date: Thu, 2 Apr 2015 13:49:24 -0700 Subject: [PATCH 09/15] Update .xproj files for Microsoft.Web.AspNet.* -> Microsoft.DNX.* rename --- samples/ErrorHandlerSample/ErrorHandlerSample.xproj | 4 ++-- samples/ErrorPageSample/ErrorPageSample.xproj | 8 ++++---- .../RuntimeInfoPageSample/RuntimeInfoPageSample.xproj | 4 ++-- .../StatusCodePagesSample/StatusCodePagesSample.xproj | 10 ++-------- samples/WelcomePageSample/WelcomePageSample.xproj | 8 ++++---- .../Microsoft.AspNet.Diagnostics.Elm.xproj | 6 +++--- .../Microsoft.AspNet.Diagnostics.Entity.xproj | 8 ++++---- .../Microsoft.AspNet.Diagnostics.Interfaces.xproj | 7 ++----- .../Microsoft.AspNet.Diagnostics.xproj | 8 ++++---- src/PageGenerator/PageGenerator.xproj | 6 +++--- ...oft.AspNet.Diagnostics.Entity.FunctionalTests.xproj | 8 ++++---- .../Microsoft.AspNet.Diagnostics.Entity.Tests.xproj | 8 ++++---- .../Microsoft.AspNet.Diagnostics.Tests.xproj | 8 ++++---- 13 files changed, 42 insertions(+), 51 deletions(-) diff --git a/samples/ErrorHandlerSample/ErrorHandlerSample.xproj b/samples/ErrorHandlerSample/ErrorHandlerSample.xproj index cfdbec9b85..8720f034d0 100644 --- a/samples/ErrorHandlerSample/ErrorHandlerSample.xproj +++ b/samples/ErrorHandlerSample/ErrorHandlerSample.xproj @@ -4,7 +4,7 @@ 14.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - + 427cdb36-78b0-4583-9ebc-7f283de60355 ..\..\artifacts\obj\$(MSBuildProjectName) @@ -14,5 +14,5 @@ 2.0 62671 - + \ No newline at end of file diff --git a/samples/ErrorPageSample/ErrorPageSample.xproj b/samples/ErrorPageSample/ErrorPageSample.xproj index 25cc761fcd..7719461fa1 100644 --- a/samples/ErrorPageSample/ErrorPageSample.xproj +++ b/samples/ErrorPageSample/ErrorPageSample.xproj @@ -1,10 +1,10 @@ - + 14.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - + 589ac17f-9455-4764-8f82-fcd2ae58da14 ..\..\artifacts\obj\$(MSBuildProjectName) @@ -13,5 +13,5 @@ 2.0 - - + + \ No newline at end of file diff --git a/samples/RuntimeInfoPageSample/RuntimeInfoPageSample.xproj b/samples/RuntimeInfoPageSample/RuntimeInfoPageSample.xproj index 8c1b79c499..66d034b3d4 100644 --- a/samples/RuntimeInfoPageSample/RuntimeInfoPageSample.xproj +++ b/samples/RuntimeInfoPageSample/RuntimeInfoPageSample.xproj @@ -4,7 +4,7 @@ 14.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - + cd62a191-39f5-4c86-bc1d-7731085120f5 ..\..\artifacts\obj\$(MSBuildProjectName) @@ -14,5 +14,5 @@ 2.0 62670 - + \ No newline at end of file diff --git a/samples/StatusCodePagesSample/StatusCodePagesSample.xproj b/samples/StatusCodePagesSample/StatusCodePagesSample.xproj index 32a014621a..70c3a2cecf 100644 --- a/samples/StatusCodePagesSample/StatusCodePagesSample.xproj +++ b/samples/StatusCodePagesSample/StatusCodePagesSample.xproj @@ -4,10 +4,9 @@ 14.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - + cc1f5841-fe10-4ddb-8477-c4de92ba759f - StatusCodePagesSample ..\..\artifacts\obj\$(MSBuildProjectName) ..\..\artifacts\bin\$(MSBuildProjectName)\ @@ -15,10 +14,5 @@ 2.0 21211 - - - - - - + \ No newline at end of file diff --git a/samples/WelcomePageSample/WelcomePageSample.xproj b/samples/WelcomePageSample/WelcomePageSample.xproj index dd1147f9ee..865f979d74 100644 --- a/samples/WelcomePageSample/WelcomePageSample.xproj +++ b/samples/WelcomePageSample/WelcomePageSample.xproj @@ -1,10 +1,10 @@ - + 14.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - + c5f59cba-df2d-4983-8cbb-11b6af21b416 ..\..\artifacts\obj\$(MSBuildProjectName) @@ -13,5 +13,5 @@ 2.0 - - + + \ No newline at end of file diff --git a/src/Microsoft.AspNet.Diagnostics.Elm/Microsoft.AspNet.Diagnostics.Elm.xproj b/src/Microsoft.AspNet.Diagnostics.Elm/Microsoft.AspNet.Diagnostics.Elm.xproj index 3f129af7cc..c73e5504fe 100644 --- a/src/Microsoft.AspNet.Diagnostics.Elm/Microsoft.AspNet.Diagnostics.Elm.xproj +++ b/src/Microsoft.AspNet.Diagnostics.Elm/Microsoft.AspNet.Diagnostics.Elm.xproj @@ -4,7 +4,7 @@ 14.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - + 624b0019-956a-4157-b008-270c5b229553 ..\..\artifacts\obj\$(MSBuildProjectName) @@ -13,5 +13,5 @@ 2.0 - - + + \ No newline at end of file diff --git a/src/Microsoft.AspNet.Diagnostics.Entity/Microsoft.AspNet.Diagnostics.Entity.xproj b/src/Microsoft.AspNet.Diagnostics.Entity/Microsoft.AspNet.Diagnostics.Entity.xproj index f72954b5ea..d00f4a41a4 100644 --- a/src/Microsoft.AspNet.Diagnostics.Entity/Microsoft.AspNet.Diagnostics.Entity.xproj +++ b/src/Microsoft.AspNet.Diagnostics.Entity/Microsoft.AspNet.Diagnostics.Entity.xproj @@ -1,10 +1,10 @@ - + 14.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - + 4f5a6a72-ffe4-49c4-b4c6-58132cfcb9fe ..\..\artifacts\obj\$(MSBuildProjectName) @@ -13,5 +13,5 @@ 2.0 - - + + \ No newline at end of file diff --git a/src/Microsoft.AspNet.Diagnostics.Interfaces/Microsoft.AspNet.Diagnostics.Interfaces.xproj b/src/Microsoft.AspNet.Diagnostics.Interfaces/Microsoft.AspNet.Diagnostics.Interfaces.xproj index fea38c9a39..d587403865 100644 --- a/src/Microsoft.AspNet.Diagnostics.Interfaces/Microsoft.AspNet.Diagnostics.Interfaces.xproj +++ b/src/Microsoft.AspNet.Diagnostics.Interfaces/Microsoft.AspNet.Diagnostics.Interfaces.xproj @@ -4,17 +4,14 @@ 14.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - + 83ffb65a-97b1-45aa-bcb8-3f43966bc8a3 - Microsoft.AspNet.Diagnostics.Interfaces ..\..\artifacts\obj\$(MSBuildProjectName) ..\..\artifacts\bin\$(MSBuildProjectName)\ - 2.0 - + \ No newline at end of file diff --git a/src/Microsoft.AspNet.Diagnostics/Microsoft.AspNet.Diagnostics.xproj b/src/Microsoft.AspNet.Diagnostics/Microsoft.AspNet.Diagnostics.xproj index 32913b1b75..8f8da9590a 100644 --- a/src/Microsoft.AspNet.Diagnostics/Microsoft.AspNet.Diagnostics.xproj +++ b/src/Microsoft.AspNet.Diagnostics/Microsoft.AspNet.Diagnostics.xproj @@ -1,10 +1,10 @@ - + 14.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - + 68a1f0e1-ecce-46d1-b20f-c43ee5b097de ..\..\artifacts\obj\$(MSBuildProjectName) @@ -13,5 +13,5 @@ 2.0 - - + + \ No newline at end of file diff --git a/src/PageGenerator/PageGenerator.xproj b/src/PageGenerator/PageGenerator.xproj index 4f80273d6e..594ce52a53 100644 --- a/src/PageGenerator/PageGenerator.xproj +++ b/src/PageGenerator/PageGenerator.xproj @@ -4,7 +4,7 @@ 14.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - + 4d4a785a-ecb9-4916-a88f-0fd306ee3b74 ..\..\artifacts\obj\$(MSBuildProjectName) @@ -14,5 +14,5 @@ 2.0 0 - - + + \ No newline at end of file diff --git a/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests.xproj b/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests.xproj index cfa72beb54..74e10116a8 100644 --- a/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests.xproj +++ b/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests.xproj @@ -1,10 +1,10 @@ - + 14.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - + 2f9b479d-8247-4210-804b-78e6dd5c3e98 ..\..\artifacts\obj\$(MSBuildProjectName) @@ -13,5 +13,5 @@ 2.0 - - + + \ No newline at end of file diff --git a/test/Microsoft.AspNet.Diagnostics.Entity.Tests/Microsoft.AspNet.Diagnostics.Entity.Tests.xproj b/test/Microsoft.AspNet.Diagnostics.Entity.Tests/Microsoft.AspNet.Diagnostics.Entity.Tests.xproj index 68fc622710..abd9dc3af9 100644 --- a/test/Microsoft.AspNet.Diagnostics.Entity.Tests/Microsoft.AspNet.Diagnostics.Entity.Tests.xproj +++ b/test/Microsoft.AspNet.Diagnostics.Entity.Tests/Microsoft.AspNet.Diagnostics.Entity.Tests.xproj @@ -1,10 +1,10 @@ - + 14.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - + 5486117b-a742-49e0-94fc-12b76f061803 ..\..\artifacts\obj\$(MSBuildProjectName) @@ -13,5 +13,5 @@ 2.0 - - + + \ No newline at end of file diff --git a/test/Microsoft.AspNet.Diagnostics.Tests/Microsoft.AspNet.Diagnostics.Tests.xproj b/test/Microsoft.AspNet.Diagnostics.Tests/Microsoft.AspNet.Diagnostics.Tests.xproj index 9f600a2be0..9a73bd16d7 100644 --- a/test/Microsoft.AspNet.Diagnostics.Tests/Microsoft.AspNet.Diagnostics.Tests.xproj +++ b/test/Microsoft.AspNet.Diagnostics.Tests/Microsoft.AspNet.Diagnostics.Tests.xproj @@ -1,10 +1,10 @@ - + 14.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - + 994351b4-7b2a-4139-8b72-72c5bb5cc618 ..\..\artifacts\obj\$(MSBuildProjectName) @@ -13,5 +13,5 @@ 2.0 - - + + \ No newline at end of file From cb6c01b8da4d05e226db232215da5a1481ecc434 Mon Sep 17 00:00:00 2001 From: "N. Taylor Mullen" Date: Thu, 2 Apr 2015 16:15:43 -0700 Subject: [PATCH 10/15] Update project.json, code=>compile. Also remove **/*.cs and **/*.vs from compile section. These are now defaulted to on. --- src/Microsoft.AspNet.Diagnostics.Entity/project.json | 2 +- test/Microsoft.AspNet.Diagnostics.Entity.Tests/project.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.AspNet.Diagnostics.Entity/project.json b/src/Microsoft.AspNet.Diagnostics.Entity/project.json index 17b16bd58e..f96f3ba9b8 100644 --- a/src/Microsoft.AspNet.Diagnostics.Entity/project.json +++ b/src/Microsoft.AspNet.Diagnostics.Entity/project.json @@ -8,7 +8,7 @@ "Microsoft.AspNet.Diagnostics": "1.0.0-*", "EntityFramework.Relational": "7.0.0-*" }, - "code": [ "**\\*.cs", "..\\Shared\\*.cs" ], + "compile": [ "..\\Shared\\*.cs" ], "frameworks": { "dnx451": { "frameworkAssemblies": { diff --git a/test/Microsoft.AspNet.Diagnostics.Entity.Tests/project.json b/test/Microsoft.AspNet.Diagnostics.Entity.Tests/project.json index a69da184dc..975e110626 100644 --- a/test/Microsoft.AspNet.Diagnostics.Entity.Tests/project.json +++ b/test/Microsoft.AspNet.Diagnostics.Entity.Tests/project.json @@ -5,7 +5,7 @@ "Moq": "4.2.1312.1622", "xunit.runner.aspnet": "2.0.0-aspnet-*" }, - "code": [ "**\\*.cs", "..\\Shared\\ApiConsistencyTestBase.cs", "..\\Shared\\TestHelpers.cs" ], + "compile": [ "..\\Shared\\ApiConsistencyTestBase.cs", "..\\Shared\\TestHelpers.cs" ], "commands": { "test": "xunit.runner.aspnet" }, From c2c374014a33ad8f7addee7a52b3f635873a7ea8 Mon Sep 17 00:00:00 2001 From: Wei Wang Date: Fri, 3 Apr 2015 17:08:57 -0700 Subject: [PATCH 11/15] Fix AppVeyor git line ending config --- appveyor.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index 88cb9ef145..3fab83e134 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,3 +1,5 @@ +init: + - git config --global core.autocrlf true build_script: - build.cmd verify clone_depth: 1 From bd1e282e58fcbea74f9eab8dd2fe9ecb0db90c92 Mon Sep 17 00:00:00 2001 From: Kiran Challa Date: Sat, 4 Apr 2015 00:34:07 -0700 Subject: [PATCH 12/15] Reacting to ILogger api changes --- src/Microsoft.AspNet.Diagnostics.Elm/ElmLogger.cs | 2 +- .../DataStoreErrorLogger.cs | 2 +- .../Helpers/TestLoggerProvider.cs | 2 +- .../ElmLoggerTest.cs | 14 +++++++++++--- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/Microsoft.AspNet.Diagnostics.Elm/ElmLogger.cs b/src/Microsoft.AspNet.Diagnostics.Elm/ElmLogger.cs index ebfdc4849d..71f466d6b0 100644 --- a/src/Microsoft.AspNet.Diagnostics.Elm/ElmLogger.cs +++ b/src/Microsoft.AspNet.Diagnostics.Elm/ElmLogger.cs @@ -57,7 +57,7 @@ namespace Microsoft.AspNet.Diagnostics.Elm return _options.Filter(_name, logLevel); } - public IDisposable BeginScope(object state) + public IDisposable BeginScopeImpl(object state) { var scope = new ElmScope(_name, state); scope.Context = ElmScope.Current?.Context ?? GetNewActivityContext(); diff --git a/src/Microsoft.AspNet.Diagnostics.Entity/DataStoreErrorLogger.cs b/src/Microsoft.AspNet.Diagnostics.Entity/DataStoreErrorLogger.cs index 01f41e42ae..68f3ad9a69 100644 --- a/src/Microsoft.AspNet.Diagnostics.Entity/DataStoreErrorLogger.cs +++ b/src/Microsoft.AspNet.Diagnostics.Entity/DataStoreErrorLogger.cs @@ -62,7 +62,7 @@ namespace Microsoft.AspNet.Diagnostics.Entity return true; } - public virtual IDisposable BeginScope(object state) + public virtual IDisposable BeginScopeImpl(object state) { return NullScope.Instance; } diff --git a/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/Helpers/TestLoggerProvider.cs b/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/Helpers/TestLoggerProvider.cs index 19c7e42cf5..f66aea4e19 100644 --- a/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/Helpers/TestLoggerProvider.cs +++ b/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/Helpers/TestLoggerProvider.cs @@ -40,7 +40,7 @@ namespace Microsoft.AspNet.Diagnostics.Entity.FunctionalTests.Helpers return true; } - public IDisposable BeginScope(object state) + public IDisposable BeginScopeImpl(object state) { return NullScope.Instance; } diff --git a/test/Microsoft.AspNet.Diagnostics.Tests/ElmLoggerTest.cs b/test/Microsoft.AspNet.Diagnostics.Tests/ElmLoggerTest.cs index e17acb48b5..5241ad3491 100644 --- a/test/Microsoft.AspNet.Diagnostics.Tests/ElmLoggerTest.cs +++ b/test/Microsoft.AspNet.Diagnostics.Tests/ElmLoggerTest.cs @@ -179,9 +179,15 @@ namespace Microsoft.AspNet.Diagnostics.Tests // Assert // get the root of the activity for scope "test2" - var root1 = (store.GetActivities()).Where(a => a.Root.State.Equals("test2"))?.FirstOrDefault()?.Root; + var root1 = (store.GetActivities()) + .Where(a => string.Equals(a.Root.State?.ToString(), "test2"))? + .FirstOrDefault()? + .Root; Assert.NotNull(root1); - var root2 = (store.GetActivities()).Where(a => a.Root.State.Equals("test12"))?.FirstOrDefault()?.Root; + var root2 = (store.GetActivities()) + .Where(a => string.Equals(a.Root.State?.ToString(), "test12"))? + .FirstOrDefault()? + .Root; Assert.NotNull(root2); Assert.Equal(0, root1.Children.Count); @@ -269,7 +275,9 @@ namespace Microsoft.AspNet.Diagnostics.Tests // Assert Assert.Single(store.GetActivities()); - var context = store.GetActivities().Where(a => a.Root.State.Equals("test8")).First(); + var context = store.GetActivities() + .Where(a => string.Equals(a.Root.State?.ToString(), "test8")) + .First(); Assert.Empty(context.Root.Children); } From 888ed4824941c4175211fe5ccc5f9eafb14f4b91 Mon Sep 17 00:00:00 2001 From: Praburaj Date: Mon, 6 Apr 2015 11:06:27 -0700 Subject: [PATCH 13/15] Using in memory store on mono --- .../DatabaseErrorPageMiddlewareTest.cs | 18 ++++++++++++++++-- .../Helpers/PlatformHelper.cs | 18 ++++++++++++++++++ .../SqlServerTestStore.cs | 18 ++++++++++-------- ...osoft.AspNet.Diagnostics.Entity.Tests.xproj | 3 +++ .../Microsoft.AspNet.Diagnostics.Tests.xproj | 3 +++ 5 files changed, 50 insertions(+), 10 deletions(-) create mode 100644 test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/Helpers/PlatformHelper.cs diff --git a/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/DatabaseErrorPageMiddlewareTest.cs b/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/DatabaseErrorPageMiddlewareTest.cs index 07531a2e9c..d1de7bbecb 100644 --- a/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/DatabaseErrorPageMiddlewareTest.cs +++ b/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/DatabaseErrorPageMiddlewareTest.cs @@ -188,7 +188,14 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests { services.AddEntityFramework().AddSqlServer(); var optionsBuilder = new DbContextOptionsBuilder(); - optionsBuilder.UseSqlServer(database.ConnectionString); + if (!PlatformHelper.IsMono) + { + optionsBuilder.UseSqlServer(database.ConnectionString); + } + else + { + optionsBuilder.UseInMemoryStore(); + } services.AddInstance(optionsBuilder.Options); }); @@ -309,7 +316,14 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests services.AddScoped(); var optionsBuilder = new DbContextOptionsBuilder(); - optionsBuilder.UseSqlServer(database.ConnectionString); + if (!PlatformHelper.IsMono) + { + optionsBuilder.UseSqlServer(database.ConnectionString); + } + else + { + optionsBuilder.UseInMemoryStore(); + } services.AddInstance(optionsBuilder.Options); }); } diff --git a/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/Helpers/PlatformHelper.cs b/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/Helpers/PlatformHelper.cs new file mode 100644 index 0000000000..79bc412bd7 --- /dev/null +++ b/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/Helpers/PlatformHelper.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; + +namespace Microsoft.AspNet.Diagnostics.Entity.FunctionalTests.Helpers +{ + public class PlatformHelper + { + public static bool IsMono + { + get + { + return Type.GetType("Mono.Runtime") != null; + } + } + } +} \ No newline at end of file diff --git a/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/SqlServerTestStore.cs b/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/SqlServerTestStore.cs index bda76c1c4a..20c13812c1 100644 --- a/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/SqlServerTestStore.cs +++ b/test/Microsoft.AspNet.Diagnostics.Entity.FunctionalTests/SqlServerTestStore.cs @@ -4,8 +4,8 @@ using System; using System.Data.SqlClient; using System.Threading; +using Microsoft.AspNet.Diagnostics.Entity.FunctionalTests.Helpers; using Microsoft.Data.Entity; -using Microsoft.Data.Entity.Infrastructure; namespace Microsoft.AspNet.Diagnostics.Entity.Tests { @@ -17,7 +17,6 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests { var name = "Microsoft.AspNet.Diagnostics.Entity.FunctionalTests.Scratch_" + Interlocked.Increment(ref _scratchCount); var db = new SqlServerTestStore(name); - db.EnsureDeleted(); return db; } @@ -31,7 +30,7 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests InitialCatalog = name, IntegratedSecurity = true, ConnectTimeout = 30 - }.ConnectionString; ; + }.ConnectionString; } public string ConnectionString @@ -41,12 +40,15 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests private void EnsureDeleted() { - var optionsBuilder = new DbContextOptionsBuilder(); - optionsBuilder.UseSqlServer(_connectionString); - - using (var db = new DbContext(optionsBuilder.Options)) + if (!PlatformHelper.IsMono) { - db.Database.EnsureDeleted(); + var optionsBuilder = new DbContextOptionsBuilder(); + optionsBuilder.UseSqlServer(_connectionString); + + using (var db = new DbContext(optionsBuilder.Options)) + { + db.Database.EnsureDeleted(); + } } } diff --git a/test/Microsoft.AspNet.Diagnostics.Entity.Tests/Microsoft.AspNet.Diagnostics.Entity.Tests.xproj b/test/Microsoft.AspNet.Diagnostics.Entity.Tests/Microsoft.AspNet.Diagnostics.Entity.Tests.xproj index abd9dc3af9..25a1b9f9dd 100644 --- a/test/Microsoft.AspNet.Diagnostics.Entity.Tests/Microsoft.AspNet.Diagnostics.Entity.Tests.xproj +++ b/test/Microsoft.AspNet.Diagnostics.Entity.Tests/Microsoft.AspNet.Diagnostics.Entity.Tests.xproj @@ -13,5 +13,8 @@ 2.0 + + + \ No newline at end of file diff --git a/test/Microsoft.AspNet.Diagnostics.Tests/Microsoft.AspNet.Diagnostics.Tests.xproj b/test/Microsoft.AspNet.Diagnostics.Tests/Microsoft.AspNet.Diagnostics.Tests.xproj index 9a73bd16d7..84f389affd 100644 --- a/test/Microsoft.AspNet.Diagnostics.Tests/Microsoft.AspNet.Diagnostics.Tests.xproj +++ b/test/Microsoft.AspNet.Diagnostics.Tests/Microsoft.AspNet.Diagnostics.Tests.xproj @@ -13,5 +13,8 @@ 2.0 + + + \ No newline at end of file From cfa6399de645b76c58245a0cf37862ad4d674fb3 Mon Sep 17 00:00:00 2001 From: "N. Taylor Mullen" Date: Tue, 7 Apr 2015 14:43:50 -0700 Subject: [PATCH 14/15] Add serviceable attribute to projects. aspnet/DNX#1600 --- .../Properties/AssemblyInfo.cs | 6 ++++++ .../Properties/AssemblyInfo.cs | 6 ++++++ .../Properties/AssemblyInfo.cs | 6 ++++++ src/Microsoft.AspNet.Diagnostics/Properties/AssemblyInfo.cs | 4 +++- 4 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 src/Microsoft.AspNet.Diagnostics.Elm/Properties/AssemblyInfo.cs create mode 100644 src/Microsoft.AspNet.Diagnostics.Entity/Properties/AssemblyInfo.cs create mode 100644 src/Microsoft.AspNet.Diagnostics.Interfaces/Properties/AssemblyInfo.cs diff --git a/src/Microsoft.AspNet.Diagnostics.Elm/Properties/AssemblyInfo.cs b/src/Microsoft.AspNet.Diagnostics.Elm/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..f5c6f4a83a --- /dev/null +++ b/src/Microsoft.AspNet.Diagnostics.Elm/Properties/AssemblyInfo.cs @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System.Reflection; + +[assembly: AssemblyMetadata("Serviceable", "True")] \ No newline at end of file diff --git a/src/Microsoft.AspNet.Diagnostics.Entity/Properties/AssemblyInfo.cs b/src/Microsoft.AspNet.Diagnostics.Entity/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..f5c6f4a83a --- /dev/null +++ b/src/Microsoft.AspNet.Diagnostics.Entity/Properties/AssemblyInfo.cs @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System.Reflection; + +[assembly: AssemblyMetadata("Serviceable", "True")] \ No newline at end of file diff --git a/src/Microsoft.AspNet.Diagnostics.Interfaces/Properties/AssemblyInfo.cs b/src/Microsoft.AspNet.Diagnostics.Interfaces/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..f5c6f4a83a --- /dev/null +++ b/src/Microsoft.AspNet.Diagnostics.Interfaces/Properties/AssemblyInfo.cs @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System.Reflection; + +[assembly: AssemblyMetadata("Serviceable", "True")] \ No newline at end of file diff --git a/src/Microsoft.AspNet.Diagnostics/Properties/AssemblyInfo.cs b/src/Microsoft.AspNet.Diagnostics/Properties/AssemblyInfo.cs index 2a2e7697fc..3913bb4409 100644 --- a/src/Microsoft.AspNet.Diagnostics/Properties/AssemblyInfo.cs +++ b/src/Microsoft.AspNet.Diagnostics/Properties/AssemblyInfo.cs @@ -1,7 +1,9 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +using System.Reflection; using System.Runtime.CompilerServices; [assembly: InternalsVisibleTo("Microsoft.AspNet.Diagnostics.Tests")] [assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")] +[assembly: AssemblyMetadata("Serviceable", "True")] From 6aa81d8f0e95706d2035147353ea35f1edd868c8 Mon Sep 17 00:00:00 2001 From: "N. Taylor Mullen" Date: Tue, 7 Apr 2015 16:14:38 -0700 Subject: [PATCH 15/15] Update .travis.yml and appveyor.yml to build quietly. --- .travis.yml | 2 +- appveyor.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5939a529e5..947bf868ee 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ language: csharp sudo: false script: - - ./build.sh verify \ No newline at end of file + - ./build.sh --quiet verify \ No newline at end of file diff --git a/appveyor.yml b/appveyor.yml index 3fab83e134..636a7618d3 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,7 +1,7 @@ init: - git config --global core.autocrlf true build_script: - - build.cmd verify + - build.cmd --quiet verify clone_depth: 1 test: off deploy: off \ No newline at end of file