From 51868b4dc0da033ca64f3a9d71ba6c841bda100b Mon Sep 17 00:00:00 2001 From: "ASP.NET CI" Date: Sun, 9 Sep 2018 12:26:19 -0700 Subject: [PATCH 01/13] Update dependencies.props [auto-updated: dependencies] --- build/dependencies.props | 20 ++++++++++---------- korebuild-lock.txt | 4 ++-- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index cd3abf6a88..3a6ea32aca 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -4,23 +4,23 @@ 0.10.13 - 2.2.0-preview1-20180821.1 - 2.2.0-preview2-35143 - 2.2.0-preview2-35143 - 2.2.0-preview2-35143 + 2.2.0-preview1-20180907.8 + 2.2.0-preview3-35202 + 2.2.0-preview3-35202 + 2.2.0-preview3-35202 15.6.82 15.6.82 15.6.82 2.8.0 2.8.0 - 2.2.0-preview2-35143 - 2.2.0-preview2-35143 + 2.2.0-preview3-35202 + 2.2.0-preview3-35202 2.1.0 - 2.2.0-preview2-35143 - 2.2.0-preview2-35143 + 2.2.0-preview3-35202 + 2.2.0-preview3-35202 2.0.9 - 2.1.2 - 2.2.0-preview1-26618-02 + 2.1.3 + 2.2.0-preview2-26905-02 15.6.1 15.0.26606 15.6.161-preview diff --git a/korebuild-lock.txt b/korebuild-lock.txt index 524a2323d0..552300b0ce 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:2.2.0-preview1-20180821.1 -commithash:c8d0cc52cd1abb697be24e288ffd54f8fae8bf17 +version:2.2.0-preview1-20180907.8 +commithash:078918eb5c1f176ee1da351c584fb4a4d7491aa0 From f93f67a53a8e30b36734216853635411d5b6b4a8 Mon Sep 17 00:00:00 2001 From: Ajay Bhargav Baaskaran Date: Mon, 10 Sep 2018 14:17:53 -0700 Subject: [PATCH 02/13] Better logging to help debug test failure (#2576) --- .../IntegrationTests/MSBuildProcessManager.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/Microsoft.AspNetCore.Razor.Design.Test/IntegrationTests/MSBuildProcessManager.cs b/test/Microsoft.AspNetCore.Razor.Design.Test/IntegrationTests/MSBuildProcessManager.cs index 93ee5030e7..cb276f27cd 100644 --- a/test/Microsoft.AspNetCore.Razor.Design.Test/IntegrationTests/MSBuildProcessManager.cs +++ b/test/Microsoft.AspNetCore.Razor.Design.Test/IntegrationTests/MSBuildProcessManager.cs @@ -17,7 +17,7 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests TimeSpan? timeout = null, MSBuildProcessKind msBuildProcessKind = MSBuildProcessKind.Dotnet) { - timeout = timeout ?? TimeSpan.FromSeconds(60); + timeout = timeout ?? TimeSpan.FromSeconds(120); var processStartInfo = new ProcessStartInfo() { @@ -77,7 +77,7 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests // This is a timeout. process.Kill(); - throw new TimeoutException($"command '${process.StartInfo.FileName} {process.StartInfo.Arguments}' timed out after {timeout}."); + throw new TimeoutException($"command '${process.StartInfo.FileName} {process.StartInfo.Arguments}' timed out after {timeout}. Output: {output.ToString()}"); }); var waitTask = Task.Run(() => From 1e8e541f6577d5e3e1a0835857fd687104560e84 Mon Sep 17 00:00:00 2001 From: Ryan Nowak Date: Thu, 13 Sep 2018 15:40:37 -0700 Subject: [PATCH 03/13] Clean up timeout reporting This was sometimes reporting a null when the timeout takes place. We need to throw with a timeout for real --- .../IntegrationTests/MSBuildProcessManager.cs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/test/Microsoft.AspNetCore.Razor.Design.Test/IntegrationTests/MSBuildProcessManager.cs b/test/Microsoft.AspNetCore.Razor.Design.Test/IntegrationTests/MSBuildProcessManager.cs index cb276f27cd..cda20de69b 100644 --- a/test/Microsoft.AspNetCore.Razor.Design.Test/IntegrationTests/MSBuildProcessManager.cs +++ b/test/Microsoft.AspNetCore.Razor.Design.Test/IntegrationTests/MSBuildProcessManager.cs @@ -60,7 +60,7 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests process.BeginErrorReadLine(); process.BeginOutputReadLine(); - var timeoutTask = Task.Delay(timeout.Value).ContinueWith((t) => + var timeoutTask = Task.Delay(timeout.Value).ContinueWith((t) => { // Don't timeout during debug sessions while (Debugger.IsAttached) @@ -68,15 +68,12 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests Thread.Sleep(TimeSpan.FromSeconds(1)); } - if (process.HasExited) + if (!process.HasExited) { - // This will happen on success, the 'real' task has already completed so this value will - // never be visible. - return (MSBuildResult)null; + // This is a timeout. + process.Kill(); } - // This is a timeout. - process.Kill(); throw new TimeoutException($"command '${process.StartInfo.FileName} {process.StartInfo.Arguments}' timed out after {timeout}. Output: {output.ToString()}"); }); From 5e083c371b2089b4009a4773d455752f6f093781 Mon Sep 17 00:00:00 2001 From: Ben Adams Date: Sun, 2 Sep 2018 13:26:52 +0100 Subject: [PATCH 04/13] Don't capture asynclocals onto Timer --- .../BackgroundDocumentGenerator.cs | 35 ++++++++++++++++--- .../DefaultVisualStudioRazorParser.cs | 24 +++++++++++-- 2 files changed, 51 insertions(+), 8 deletions(-) diff --git a/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentGenerator/BackgroundDocumentGenerator.cs b/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentGenerator/BackgroundDocumentGenerator.cs index 122e577abe..2ddde78e98 100644 --- a/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentGenerator/BackgroundDocumentGenerator.cs +++ b/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentGenerator/BackgroundDocumentGenerator.cs @@ -149,12 +149,35 @@ namespace Microsoft.CodeAnalysis.Razor // Access to the timer is protected by the lock in Enqueue and in Timer_Tick if (_timer == null) { - // Timer will fire after a fixed delay, but only once. - _timer = new Timer(Timer_Tick, null, Delay, Timeout.InfiniteTimeSpan); + // Don't capture asynclocals onto Timer + bool restoreFlow = false; + try + { + if (!ExecutionContext.IsFlowSuppressed()) + { + ExecutionContext.SuppressFlow(); + restoreFlow = true; + } + + // Timer will fire after a fixed delay, but only once. + _timer = new Timer(state => ((BackgroundDocumentGenerator)state).Timer_Tick(), this, Delay, Timeout.InfiniteTimeSpan); + } + finally + { + if (restoreFlow) + { + ExecutionContext.RestoreFlow(); + } + } } } - private async void Timer_Tick(object state) // Yeah I know. + private void Timer_Tick() + { + _ = TimerTick(); + } + + private async Task TimerTick() { try { @@ -208,7 +231,8 @@ namespace Microsoft.CodeAnalysis.Razor { // This is something totally unexpected, let's just send it over to the workspace. await Task.Factory.StartNew( - () => _projectManager.ReportError(ex), + (p) => ((ProjectSnapshotManagerBase)p).ReportError(ex), + _projectManager, CancellationToken.None, TaskCreationOptions.None, _foregroundDispatcher.ForegroundScheduler); @@ -218,7 +242,8 @@ namespace Microsoft.CodeAnalysis.Razor private void ReportError(DocumentSnapshot document, Exception ex) { GC.KeepAlive(Task.Factory.StartNew( - () => _projectManager.ReportError(ex), + (p) => ((ProjectSnapshotManagerBase)p).ReportError(ex), + _projectManager, CancellationToken.None, TaskCreationOptions.None, _foregroundDispatcher.ForegroundScheduler)); diff --git a/src/Microsoft.VisualStudio.Editor.Razor/DefaultVisualStudioRazorParser.cs b/src/Microsoft.VisualStudio.Editor.Razor/DefaultVisualStudioRazorParser.cs index 23ae8208c5..601dba2fc2 100644 --- a/src/Microsoft.VisualStudio.Editor.Razor/DefaultVisualStudioRazorParser.cs +++ b/src/Microsoft.VisualStudio.Editor.Razor/DefaultVisualStudioRazorParser.cs @@ -213,8 +213,26 @@ namespace Microsoft.VisualStudio.Editor.Razor { if (_idleTimer == null) { - // Timer will fire after a fixed delay, but only once. - _idleTimer = new Timer(Timer_Tick, null, IdleDelay, Timeout.InfiniteTimeSpan); + // Don't capture asynclocals onto Timer + bool restoreFlow = false; + try + { + if (!ExecutionContext.IsFlowSuppressed()) + { + ExecutionContext.SuppressFlow(); + restoreFlow = true; + } + + // Timer will fire after a fixed delay, but only once. + _idleTimer = new Timer(state => ((DefaultVisualStudioRazorParser)state).Timer_Tick(), this, IdleDelay, Timeout.InfiniteTimeSpan); + } + finally + { + if (restoreFlow) + { + ExecutionContext.RestoreFlow(); + } + } } } } @@ -337,7 +355,7 @@ namespace Microsoft.VisualStudio.Editor.Razor } } - private void Timer_Tick(object state) + private void Timer_Tick() { try { From 2bf00ff9a6848a076fe136e20b21be1951ff932f Mon Sep 17 00:00:00 2001 From: "ASP.NET CI" Date: Sun, 16 Sep 2018 12:24:47 -0700 Subject: [PATCH 05/13] Update dependencies.props [auto-updated: dependencies] --- build/dependencies.props | 16 ++++++++-------- korebuild-lock.txt | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index 3a6ea32aca..3d59a7a667 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -4,20 +4,20 @@ 0.10.13 - 2.2.0-preview1-20180907.8 - 2.2.0-preview3-35202 - 2.2.0-preview3-35202 - 2.2.0-preview3-35202 + 2.2.0-preview1-20180911.1 + 2.2.0-preview3-35252 + 2.2.0-preview3-35252 + 2.2.0-preview3-35252 15.6.82 15.6.82 15.6.82 2.8.0 2.8.0 - 2.2.0-preview3-35202 - 2.2.0-preview3-35202 + 2.2.0-preview3-35252 + 2.2.0-preview3-35252 2.1.0 - 2.2.0-preview3-35202 - 2.2.0-preview3-35202 + 2.2.0-preview3-35252 + 2.2.0-preview3-35252 2.0.9 2.1.3 2.2.0-preview2-26905-02 diff --git a/korebuild-lock.txt b/korebuild-lock.txt index 552300b0ce..1090ad6a92 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:2.2.0-preview1-20180907.8 -commithash:078918eb5c1f176ee1da351c584fb4a4d7491aa0 +version:2.2.0-preview1-20180911.1 +commithash:ddfecdfc6e8e4859db5a0daea578070b862aac65 From 060698a52f3e0847861b1516612c6058a436bef5 Mon Sep 17 00:00:00 2001 From: Ryan Nowak Date: Thu, 13 Sep 2018 18:30:37 -0700 Subject: [PATCH 06/13] Update to use non-capturing timer --- build/dependencies.props | 1 + .../BackgroundDocumentGenerator.cs | 22 +++--------------- ...osoft.CodeAnalysis.Razor.Workspaces.csproj | 1 + .../DefaultVisualStudioRazorParser.cs | 23 +++---------------- 4 files changed, 8 insertions(+), 39 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index 3d59a7a667..1bc3096ec5 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -17,6 +17,7 @@ 2.2.0-preview3-35252 2.1.0 2.2.0-preview3-35252 + 2.2.0-preview3-35252 2.2.0-preview3-35252 2.0.9 2.1.3 diff --git a/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentGenerator/BackgroundDocumentGenerator.cs b/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentGenerator/BackgroundDocumentGenerator.cs index 2ddde78e98..eba3c12e25 100644 --- a/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentGenerator/BackgroundDocumentGenerator.cs +++ b/src/Microsoft.CodeAnalysis.Razor.Workspaces/DocumentGenerator/BackgroundDocumentGenerator.cs @@ -8,6 +8,7 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis.Razor.ProjectSystem; +using Microsoft.Extensions.Internal; namespace Microsoft.CodeAnalysis.Razor { @@ -149,26 +150,9 @@ namespace Microsoft.CodeAnalysis.Razor // Access to the timer is protected by the lock in Enqueue and in Timer_Tick if (_timer == null) { - // Don't capture asynclocals onto Timer - bool restoreFlow = false; - try - { - if (!ExecutionContext.IsFlowSuppressed()) - { - ExecutionContext.SuppressFlow(); - restoreFlow = true; - } - // Timer will fire after a fixed delay, but only once. - _timer = new Timer(state => ((BackgroundDocumentGenerator)state).Timer_Tick(), this, Delay, Timeout.InfiniteTimeSpan); - } - finally - { - if (restoreFlow) - { - ExecutionContext.RestoreFlow(); - } - } + // Timer will fire after a fixed delay, but only once. + _timer = NonCapturingTimer.Create(state => ((BackgroundDocumentGenerator)state).Timer_Tick(), this, Delay, Timeout.InfiniteTimeSpan); } } diff --git a/src/Microsoft.CodeAnalysis.Razor.Workspaces/Microsoft.CodeAnalysis.Razor.Workspaces.csproj b/src/Microsoft.CodeAnalysis.Razor.Workspaces/Microsoft.CodeAnalysis.Razor.Workspaces.csproj index e7f29a2fb0..ca09c13e78 100644 --- a/src/Microsoft.CodeAnalysis.Razor.Workspaces/Microsoft.CodeAnalysis.Razor.Workspaces.csproj +++ b/src/Microsoft.CodeAnalysis.Razor.Workspaces/Microsoft.CodeAnalysis.Razor.Workspaces.csproj @@ -13,6 +13,7 @@ + diff --git a/src/Microsoft.VisualStudio.Editor.Razor/DefaultVisualStudioRazorParser.cs b/src/Microsoft.VisualStudio.Editor.Razor/DefaultVisualStudioRazorParser.cs index 601dba2fc2..25d446febf 100644 --- a/src/Microsoft.VisualStudio.Editor.Razor/DefaultVisualStudioRazorParser.cs +++ b/src/Microsoft.VisualStudio.Editor.Razor/DefaultVisualStudioRazorParser.cs @@ -11,6 +11,7 @@ using Microsoft.AspNetCore.Razor.Language; using Microsoft.AspNetCore.Razor.Language.Legacy; using Microsoft.CodeAnalysis.Razor; using Microsoft.CodeAnalysis.Razor.Editor; +using Microsoft.Extensions.Internal; using Microsoft.VisualStudio.Text; using static Microsoft.VisualStudio.Editor.Razor.BackgroundParser; using ITextBuffer = Microsoft.VisualStudio.Text.ITextBuffer; @@ -213,26 +214,8 @@ namespace Microsoft.VisualStudio.Editor.Razor { if (_idleTimer == null) { - // Don't capture asynclocals onto Timer - bool restoreFlow = false; - try - { - if (!ExecutionContext.IsFlowSuppressed()) - { - ExecutionContext.SuppressFlow(); - restoreFlow = true; - } - - // Timer will fire after a fixed delay, but only once. - _idleTimer = new Timer(state => ((DefaultVisualStudioRazorParser)state).Timer_Tick(), this, IdleDelay, Timeout.InfiniteTimeSpan); - } - finally - { - if (restoreFlow) - { - ExecutionContext.RestoreFlow(); - } - } + // Timer will fire after a fixed delay, but only once. + _idleTimer = NonCapturingTimer.Create(state => ((DefaultVisualStudioRazorParser)state).Timer_Tick(), this, IdleDelay, Timeout.InfiniteTimeSpan); } } } From fc86cc3ca1101d0503392a902d4336fa20f575f6 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Mon, 17 Sep 2018 17:06:41 -0700 Subject: [PATCH 07/13] Allow Invoke \ InvokeAsync methods for a ViewComponent to be defined in base types Fixes https://github.com/aspnet/Mvc/issues/8397 --- ...ViewComponentTagHelperDescriptorFactory.cs | 39 +++-- .../TagHelperDescriptorComparer.cs | 91 ++++++++--- ...ComponentTagHelperDescriptorFactoryTest.cs | 142 ++++++++++++++++++ 3 files changed, 239 insertions(+), 33 deletions(-) diff --git a/src/Microsoft.AspNetCore.Mvc.Razor.Extensions/ViewComponentTagHelperDescriptorFactory.cs b/src/Microsoft.AspNetCore.Mvc.Razor.Extensions/ViewComponentTagHelperDescriptorFactory.cs index cb64a4611a..a5181fd789 100644 --- a/src/Microsoft.AspNetCore.Mvc.Razor.Extensions/ViewComponentTagHelperDescriptorFactory.cs +++ b/src/Microsoft.AspNetCore.Mvc.Razor.Extensions/ViewComponentTagHelperDescriptorFactory.cs @@ -59,7 +59,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions var descriptorBuilder = TagHelperDescriptorBuilder.Create(ViewComponentTagHelperConventions.Kind, typeName, assemblyName); descriptorBuilder.SetTypeName(typeName); descriptorBuilder.DisplayName = displayName; - + if (TryFindInvokeMethod(type, out var method, out var diagnostic)) { var methodParameters = method.Parameters; @@ -84,21 +84,15 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions private bool TryFindInvokeMethod(INamedTypeSymbol type, out IMethodSymbol method, out RazorDiagnostic diagnostic) { - var methods = type.GetMembers() - .OfType() - .Where(m => - m.DeclaredAccessibility == Accessibility.Public && - (string.Equals(m.Name, ViewComponentTypes.AsyncMethodName, StringComparison.Ordinal) || - string.Equals(m.Name, ViewComponentTypes.SyncMethodName, StringComparison.Ordinal))) - .ToArray(); + var methods = GetInvokeMethods(type); - if (methods.Length == 0) + if (methods.Count == 0) { - diagnostic = RazorExtensionsDiagnosticFactory.CreateViewComponent_CannotFindMethod(type.ToDisplayString(FullNameTypeDisplayFormat)); + diagnostic = RazorExtensionsDiagnosticFactory.CreateViewComponent_CannotFindMethod(type.ToDisplayString(FullNameTypeDisplayFormat)); method = null; return false; } - else if (methods.Length > 1) + else if (methods.Count > 1) { diagnostic = RazorExtensionsDiagnosticFactory.CreateViewComponent_AmbiguousMethods(type.ToDisplayString(FullNameTypeDisplayFormat)); method = null; @@ -153,6 +147,27 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions return true; } + private static IReadOnlyList GetInvokeMethods(INamedTypeSymbol type) + { + var methods = new List(); + while (type != null) + { + var currentTypeMethods = type.GetMembers() + .OfType() + .Where(m => + m.DeclaredAccessibility == Accessibility.Public && + !m.IsStatic && + (string.Equals(m.Name, ViewComponentTypes.AsyncMethodName, StringComparison.Ordinal) || + string.Equals(m.Name, ViewComponentTypes.SyncMethodName, StringComparison.Ordinal))); + + methods.AddRange(currentTypeMethods); + + type = type.BaseType; + } + + return methods; + } + private void AddRequiredAttributes(ImmutableArray methodParameters, TagMatchingRuleDescriptorBuilder builder) { foreach (var parameter in methodParameters) @@ -164,7 +179,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions builder.Attribute(attributeBuilder => { var lowerKebabName = HtmlConventions.ToHtmlCase(parameter.Name); - attributeBuilder.Name =lowerKebabName; + attributeBuilder.Name = lowerKebabName; }); } } diff --git a/src/Microsoft.AspNetCore.Razor.Language/TagHelperDescriptorComparer.cs b/src/Microsoft.AspNetCore.Razor.Language/TagHelperDescriptorComparer.cs index 64f5206a7b..5ca9c0fe91 100644 --- a/src/Microsoft.AspNetCore.Razor.Language/TagHelperDescriptorComparer.cs +++ b/src/Microsoft.AspNetCore.Razor.Language/TagHelperDescriptorComparer.cs @@ -59,32 +59,81 @@ namespace Microsoft.AspNetCore.Razor.Language return false; } - return descriptorX != null && - string.Equals(descriptorX.Kind, descriptorY.Kind, StringComparison.Ordinal) && - string.Equals(descriptorX.AssemblyName, descriptorY.AssemblyName, StringComparison.Ordinal) && - string.Equals(descriptorX.Name, descriptorY.Name, StringComparison.Ordinal) && - Enumerable.SequenceEqual( - descriptorX.BoundAttributes.OrderBy(attribute => attribute.Name, _stringComparer), - descriptorY.BoundAttributes.OrderBy(attribute => attribute.Name, _stringComparer), - _boundAttributeComparer) && - Enumerable.SequenceEqual( - descriptorX.TagMatchingRules.OrderBy(rule => rule.TagName, _stringComparer), - descriptorY.TagMatchingRules.OrderBy(rule => rule.TagName, _stringComparer), - _tagMatchingRuleComparer) && - (descriptorX.AllowedChildTags == descriptorY.AllowedChildTags || + if (descriptorX == null) + { + return false; + } + + if (!string.Equals(descriptorX.Kind, descriptorY.Kind, StringComparison.Ordinal)) + { + return false; + } + + if (!string.Equals(descriptorX.AssemblyName, descriptorY.AssemblyName, StringComparison.Ordinal)) + { + return false; + } + + if (!string.Equals(descriptorX.Name, descriptorY.Name, StringComparison.Ordinal)) + { + return false; + } + + if (!Enumerable.SequenceEqual( + descriptorX.BoundAttributes.OrderBy(attribute => attribute.Name, _stringComparer), + descriptorY.BoundAttributes.OrderBy(attribute => attribute.Name, _stringComparer), + _boundAttributeComparer)) + { + return false; + } + + if (!Enumerable.SequenceEqual( + descriptorX.TagMatchingRules.OrderBy(rule => rule.TagName, _stringComparer), + descriptorY.TagMatchingRules.OrderBy(rule => rule.TagName, _stringComparer), + _tagMatchingRuleComparer)) + { + return false; + } + + if (!(descriptorX.AllowedChildTags == descriptorY.AllowedChildTags || (descriptorX.AllowedChildTags != null && descriptorY.AllowedChildTags != null && Enumerable.SequenceEqual( descriptorX.AllowedChildTags.OrderBy(childTag => childTag.Name, _stringComparer), descriptorY.AllowedChildTags.OrderBy(childTag => childTag.Name, _stringComparer), - _AllowedChildTagDescriptorComparer))) && - string.Equals(descriptorX.Documentation, descriptorY.Documentation, StringComparison.Ordinal) && - string.Equals(descriptorX.DisplayName, descriptorY.DisplayName, StringComparison.Ordinal) && - string.Equals(descriptorX.TagOutputHint, descriptorY.TagOutputHint, _stringComparison) && - Enumerable.SequenceEqual(descriptorX.Diagnostics, descriptorY.Diagnostics) && - Enumerable.SequenceEqual( - descriptorX.Metadata.OrderBy(metadataX => metadataX.Key, StringComparer.Ordinal), - descriptorY.Metadata.OrderBy(metadataY => metadataY.Key, StringComparer.Ordinal)); + _AllowedChildTagDescriptorComparer)))) + { + return false; + } + + if (!string.Equals(descriptorX.Documentation, descriptorY.Documentation, StringComparison.Ordinal)) + { + return false; + } + + if (!string.Equals(descriptorX.DisplayName, descriptorY.DisplayName, StringComparison.Ordinal)) + { + return false; + } + + if (!string.Equals(descriptorX.TagOutputHint, descriptorY.TagOutputHint, _stringComparison)) + { + return false; + } + + if (!Enumerable.SequenceEqual(descriptorX.Diagnostics, descriptorY.Diagnostics)) + { + return false; + } + + if (!Enumerable.SequenceEqual( + descriptorX.Metadata.OrderBy(metadataX => metadataX.Key, StringComparer.Ordinal), + descriptorY.Metadata.OrderBy(metadataY => metadataY.Key, StringComparer.Ordinal))) + { + return false; + } + + return true; } /// diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/ViewComponentTagHelperDescriptorFactoryTest.cs b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/ViewComponentTagHelperDescriptorFactoryTest.cs index aa0065c770..d44f0169a1 100644 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/ViewComponentTagHelperDescriptorFactoryTest.cs +++ b/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test/ViewComponentTagHelperDescriptorFactoryTest.cs @@ -145,6 +145,74 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions Assert.Equal(expectedDescriptor, descriptor, TagHelperDescriptorComparer.CaseSensitive); } + [Fact] + public void CreateDescriptor_ForSyncViewComponentWithInvokeInBaseType_Works() + { + // Arrange + var testCompilation = TestCompilation.Create(_assembly); + var factory = new ViewComponentTagHelperDescriptorFactory(testCompilation); + + var expectedDescriptor = TagHelperDescriptorBuilder.Create( + ViewComponentTagHelperConventions.Kind, + "__Generated__SyncDerivedViewComponentTagHelper", + typeof(SyncDerivedViewComponent).GetTypeInfo().Assembly.GetName().Name) + .TypeName("__Generated__SyncDerivedViewComponentTagHelper") + .DisplayName("SyncDerivedViewComponentTagHelper") + .TagMatchingRuleDescriptor(rule => + rule + .RequireTagName("vc:sync-derived") + .RequireAttributeDescriptor(attribute => attribute.Name("foo")) + .RequireAttributeDescriptor(attribute => attribute.Name("bar"))) + .BoundAttributeDescriptor(attribute => + attribute + .Name("foo") + .PropertyName("foo") + .TypeName(typeof(string).FullName) + .DisplayName("string SyncDerivedViewComponentTagHelper.foo")) + .BoundAttributeDescriptor(attribute => + attribute + .Name("bar") + .PropertyName("bar") + .TypeName(typeof(string).FullName) + .DisplayName("string SyncDerivedViewComponentTagHelper.bar")) + .AddMetadata(ViewComponentTagHelperMetadata.Name, "SyncDerived") + .Build(); + + var viewComponent = testCompilation.GetTypeByMetadataName(typeof(SyncDerivedViewComponent).FullName); + + // Act + var descriptor = factory.CreateDescriptor(viewComponent); + + // Assert + Assert.Equal(expectedDescriptor, descriptor, TagHelperDescriptorComparer.CaseSensitive); + } + + [Fact] + public void CreateDescriptor_ForAsyncViewComponentWithInvokeInBaseType_Works() + { + // Arrange + var testCompilation = TestCompilation.Create(_assembly); + var factory = new ViewComponentTagHelperDescriptorFactory(testCompilation); + + var expectedDescriptor = TagHelperDescriptorBuilder.Create( + ViewComponentTagHelperConventions.Kind, + "__Generated__AsyncDerivedViewComponentTagHelper", + typeof(AsyncDerivedViewComponent).Assembly.GetName().Name) + .TypeName("__Generated__AsyncDerivedViewComponentTagHelper") + .DisplayName("AsyncDerivedViewComponentTagHelper") + .TagMatchingRuleDescriptor(rule => rule.RequireTagName("vc:async-derived")) + .AddMetadata(ViewComponentTagHelperMetadata.Name, "AsyncDerived") + .Build(); + + var viewComponent = testCompilation.GetTypeByMetadataName(typeof(AsyncDerivedViewComponent).FullName); + + // Act + var descriptor = factory.CreateDescriptor(viewComponent); + + // Assert + Assert.Equal(expectedDescriptor, descriptor, TagHelperDescriptorComparer.CaseSensitive); + } + [Fact] public void CreateDescriptor_AddsDiagnostic_ForViewComponentWithNoInvokeMethod() { @@ -162,6 +230,40 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions Assert.Equal(RazorExtensionsDiagnosticFactory.ViewComponent_CannotFindMethod.Id, diagnostic.Id); } + [Fact] + public void CreateDescriptor_AddsDiagnostic_ForViewComponentWithNoInstanceInvokeMethod() + { + // Arrange + var testCompilation = TestCompilation.Create(_assembly); + var factory = new ViewComponentTagHelperDescriptorFactory(testCompilation); + + var viewComponent = testCompilation.GetTypeByMetadataName(typeof(StaticInvokeAsyncViewComponent).FullName); + + // Act + var descriptor = factory.CreateDescriptor(viewComponent); + + // Assert + var diagnostic = Assert.Single(descriptor.GetAllDiagnostics()); + Assert.Equal(RazorExtensionsDiagnosticFactory.ViewComponent_CannotFindMethod.Id, diagnostic.Id); + } + + [Fact] + public void CreateDescriptor_AddsDiagnostic_ForViewComponentWithNoPublicInvokeMethod() + { + // Arrange + var testCompilation = TestCompilation.Create(_assembly); + var factory = new ViewComponentTagHelperDescriptorFactory(testCompilation); + + var viewComponent = testCompilation.GetTypeByMetadataName(typeof(NonPublicInvokeAsyncViewComponent).FullName); + + // Act + var descriptor = factory.CreateDescriptor(viewComponent); + + // Assert + var diagnostic = Assert.Single(descriptor.GetAllDiagnostics()); + Assert.Equal(RazorExtensionsDiagnosticFactory.ViewComponent_CannotFindMethod.Id, diagnostic.Id); + } + [Fact] public void CreateDescriptor_ForViewComponentWithInvokeAsync_UnderstandsGenericTask() { @@ -278,6 +380,23 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions var diagnostic = Assert.Single(descriptor.GetAllDiagnostics()); Assert.Equal(RazorExtensionsDiagnosticFactory.ViewComponent_SyncMethod_CannotReturnTask.Id, diagnostic.Id); } + + [Fact] + public void CreateDescriptor_ForViewComponent_WithAmbiguousMethods() + { + // Arrange + var testCompilation = TestCompilation.Create(_assembly); + var factory = new ViewComponentTagHelperDescriptorFactory(testCompilation); + + var viewComponent = testCompilation.GetTypeByMetadataName(typeof(DerivedViewComponentWithAmbiguity).FullName); + + // Act + var descriptor = factory.CreateDescriptor(viewComponent); + + // Assert + var diagnostic = Assert.Single(descriptor.GetAllDiagnostics()); + Assert.Equal(RazorExtensionsDiagnosticFactory.ViewComponent_AmbiguousMethods.Id, diagnostic.Id); + } } public class StringParameterViewComponent @@ -340,4 +459,27 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions { public Task Invoke() => null; } + + public class SyncDerivedViewComponent : StringParameterViewComponent + { + } + + public class AsyncDerivedViewComponent : AsyncViewComponentWithNonGenericTask + { + } + + public class DerivedViewComponentWithAmbiguity : AsyncViewComponentWithNonGenericTask + { + public string Invoke() => null; + } + + public class StaticInvokeAsyncViewComponent + { + public static Task InvokeAsync() => null; + } + + public class NonPublicInvokeAsyncViewComponent + { + protected Task InvokeAsync() => null; + } } \ No newline at end of file From 7144add4adb0e18ac897268173556abd187c84ad Mon Sep 17 00:00:00 2001 From: Pranav K Date: Tue, 18 Sep 2018 16:52:34 -0700 Subject: [PATCH 08/13] Check for ITagHelper in tag helper feature provider (#2602) Fixes #2482 --- .../ViewComponentTagHelperDescriptorProvider.cs | 10 +++++++++- .../ViewComponentTypeVisitor.cs | 16 ---------------- .../ViewComponentTagHelperDescriptorProvider.cs | 10 +++++++++- .../ViewComponentTypeVisitor.cs | 7 ------- .../CompilationTagHelperFeature.cs | 10 +++------- .../DefaultTagHelperDescriptorProvider.cs | 9 ++++++++- .../TagHelperTypeVisitor.cs | 6 ------ .../CompilationTagHelperFeatureTest.cs | 4 ++-- 8 files changed, 31 insertions(+), 41 deletions(-) diff --git a/src/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X/ViewComponentTagHelperDescriptorProvider.cs b/src/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X/ViewComponentTagHelperDescriptorProvider.cs index af79139c69..318994ec0e 100644 --- a/src/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X/ViewComponentTagHelperDescriptorProvider.cs +++ b/src/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X/ViewComponentTagHelperDescriptorProvider.cs @@ -27,8 +27,16 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X return; } + var vcAttribute = compilation.GetTypeByMetadataName(ViewComponentTypes.ViewComponentAttribute); + var nonVCAttribute = compilation.GetTypeByMetadataName(ViewComponentTypes.NonViewComponentAttribute); + if (vcAttribute == null || vcAttribute.TypeKind == TypeKind.Error) + { + // Could not find attributes we care about in the compilation. Nothing to do. + return; + } + var types = new List(); - var visitor = ViewComponentTypeVisitor.Create(compilation, types); + var visitor = new ViewComponentTypeVisitor(vcAttribute, nonVCAttribute, types); // We always visit the global namespace. visitor.Visit(compilation.Assembly.GlobalNamespace); diff --git a/src/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X/ViewComponentTypeVisitor.cs b/src/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X/ViewComponentTypeVisitor.cs index be987cbdd5..db0912087a 100644 --- a/src/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X/ViewComponentTypeVisitor.cs +++ b/src/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X/ViewComponentTypeVisitor.cs @@ -16,13 +16,6 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X private readonly INamedTypeSymbol _nonViewComponentAttribute; private readonly List _results; - public static ViewComponentTypeVisitor Create(Compilation compilation, List results) - { - var vcAttribute = compilation.GetTypeByMetadataName(ViewComponentTypes.ViewComponentAttribute); - var nonVCAttribute = compilation.GetTypeByMetadataName(ViewComponentTypes.NonViewComponentAttribute); - return new ViewComponentTypeVisitor(vcAttribute, nonVCAttribute, results); - } - public ViewComponentTypeVisitor( INamedTypeSymbol viewComponentAttribute, INamedTypeSymbol nonViewComponentAttribute, @@ -31,12 +24,8 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X _viewComponentAttribute = viewComponentAttribute; _nonViewComponentAttribute = nonViewComponentAttribute; _results = results; - - Enabled = _viewComponentAttribute != null; } - public bool Enabled { get; set; } - public override void VisitNamedType(INamedTypeSymbol symbol) { if (IsViewComponent(symbol)) @@ -65,11 +54,6 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X internal bool IsViewComponent(INamedTypeSymbol symbol) { - if (!Enabled) - { - return false; - } - if (symbol.DeclaredAccessibility != Accessibility.Public || symbol.IsAbstract || symbol.IsGenericType || diff --git a/src/Microsoft.AspNetCore.Mvc.Razor.Extensions/ViewComponentTagHelperDescriptorProvider.cs b/src/Microsoft.AspNetCore.Mvc.Razor.Extensions/ViewComponentTagHelperDescriptorProvider.cs index a5c05dc585..d0d9805f6b 100644 --- a/src/Microsoft.AspNetCore.Mvc.Razor.Extensions/ViewComponentTagHelperDescriptorProvider.cs +++ b/src/Microsoft.AspNetCore.Mvc.Razor.Extensions/ViewComponentTagHelperDescriptorProvider.cs @@ -27,8 +27,16 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions return; } + var vcAttribute = compilation.GetTypeByMetadataName(ViewComponentTypes.ViewComponentAttribute); + var nonVCAttribute = compilation.GetTypeByMetadataName(ViewComponentTypes.NonViewComponentAttribute); + if (vcAttribute == null || vcAttribute.TypeKind == TypeKind.Error) + { + // Could not find attributes we care about in the compilation. Nothing to do. + return; + } + var types = new List(); - var visitor = ViewComponentTypeVisitor.Create(compilation, types); + var visitor = new ViewComponentTypeVisitor(vcAttribute, nonVCAttribute, types); // We always visit the global namespace. visitor.Visit(compilation.Assembly.GlobalNamespace); diff --git a/src/Microsoft.AspNetCore.Mvc.Razor.Extensions/ViewComponentTypeVisitor.cs b/src/Microsoft.AspNetCore.Mvc.Razor.Extensions/ViewComponentTypeVisitor.cs index 2fd215d99d..9e1f936060 100644 --- a/src/Microsoft.AspNetCore.Mvc.Razor.Extensions/ViewComponentTypeVisitor.cs +++ b/src/Microsoft.AspNetCore.Mvc.Razor.Extensions/ViewComponentTypeVisitor.cs @@ -13,13 +13,6 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions private readonly INamedTypeSymbol _nonViewComponentAttribute; private readonly List _results; - public static ViewComponentTypeVisitor Create(Compilation compilation, List results) - { - var vcAttribute = compilation.GetTypeByMetadataName(ViewComponentTypes.ViewComponentAttribute); - var nonVCAttribute = compilation.GetTypeByMetadataName(ViewComponentTypes.NonViewComponentAttribute); - return new ViewComponentTypeVisitor(vcAttribute, nonVCAttribute, results); - } - public ViewComponentTypeVisitor( INamedTypeSymbol viewComponentAttribute, INamedTypeSymbol nonViewComponentAttribute, diff --git a/src/Microsoft.CodeAnalysis.Razor/CompilationTagHelperFeature.cs b/src/Microsoft.CodeAnalysis.Razor/CompilationTagHelperFeature.cs index 2b343f74e2..2041cd9eb5 100644 --- a/src/Microsoft.CodeAnalysis.Razor/CompilationTagHelperFeature.cs +++ b/src/Microsoft.CodeAnalysis.Razor/CompilationTagHelperFeature.cs @@ -40,15 +40,11 @@ namespace Microsoft.CodeAnalysis.Razor internal static bool IsValidCompilation(Compilation compilation) { - var iTagHelper = compilation.GetTypeByMetadataName(TagHelperTypes.ITagHelper); var @string = compilation.GetSpecialType(SpecialType.System_String); - // Do some minimal tests to verify the compilation is valid. If symbols for ITagHelper or System.String - // are missing or errored, the compilation may be missing references. - return iTagHelper != null && - iTagHelper.TypeKind != TypeKind.Error && - @string != null && - @string.TypeKind != TypeKind.Error; + // Do some minimal tests to verify the compilation is valid. If symbols for System.String + // is missing or errored, the compilation may be missing references. + return @string != null && @string.TypeKind != TypeKind.Error; } } } diff --git a/src/Microsoft.CodeAnalysis.Razor/DefaultTagHelperDescriptorProvider.cs b/src/Microsoft.CodeAnalysis.Razor/DefaultTagHelperDescriptorProvider.cs index b0d07db459..ebb649da5b 100644 --- a/src/Microsoft.CodeAnalysis.Razor/DefaultTagHelperDescriptorProvider.cs +++ b/src/Microsoft.CodeAnalysis.Razor/DefaultTagHelperDescriptorProvider.cs @@ -31,8 +31,15 @@ namespace Microsoft.CodeAnalysis.Razor return; } + var iTagHelper = compilation.GetTypeByMetadataName(TagHelperTypes.ITagHelper); + if (iTagHelper == null || iTagHelper.TypeKind == TypeKind.Error) + { + // Could not find attributes we care about in the compilation. Nothing to do. + return; + } + var types = new List(); - var visitor = TagHelperTypeVisitor.Create(compilation, types); + var visitor = new TagHelperTypeVisitor(iTagHelper, types); // We always visit the global namespace. visitor.Visit(compilation.Assembly.GlobalNamespace); diff --git a/src/Microsoft.CodeAnalysis.Razor/TagHelperTypeVisitor.cs b/src/Microsoft.CodeAnalysis.Razor/TagHelperTypeVisitor.cs index aa240a1eac..3387cfd1e8 100644 --- a/src/Microsoft.CodeAnalysis.Razor/TagHelperTypeVisitor.cs +++ b/src/Microsoft.CodeAnalysis.Razor/TagHelperTypeVisitor.cs @@ -11,12 +11,6 @@ namespace Microsoft.CodeAnalysis.Razor private INamedTypeSymbol _interface; private List _results; - public static TagHelperTypeVisitor Create(Compilation compilation, List results) - { - var @interface = compilation.GetTypeByMetadataName(TagHelperTypes.ITagHelper); - return new TagHelperTypeVisitor(@interface, results); - } - public TagHelperTypeVisitor(INamedTypeSymbol @interface, List results) { _interface = @interface; diff --git a/test/Microsoft.CodeAnalysis.Razor.Test/CompilationTagHelperFeatureTest.cs b/test/Microsoft.CodeAnalysis.Razor.Test/CompilationTagHelperFeatureTest.cs index e545d671e2..53aeb98031 100644 --- a/test/Microsoft.CodeAnalysis.Razor.Test/CompilationTagHelperFeatureTest.cs +++ b/test/Microsoft.CodeAnalysis.Razor.Test/CompilationTagHelperFeatureTest.cs @@ -13,7 +13,7 @@ namespace Microsoft.CodeAnalysis.Razor public class CompilationTagHelperFeatureTest { [Fact] - public void IsValidCompilation_ReturnsFalseIfITagHelperInterfaceCannotBeFound() + public void IsValidCompilation_ReturnsTrueIfTagHelperInterfaceCannotBeFound() { // Arrange var references = new[] @@ -26,7 +26,7 @@ namespace Microsoft.CodeAnalysis.Razor var result = CompilationTagHelperFeature.IsValidCompilation(compilation); // Assert - Assert.False(result); + Assert.True(result); } [Fact] From f70df60435a769a10eb7831e2900feb0f7b7367c Mon Sep 17 00:00:00 2001 From: Pranav K Date: Fri, 14 Sep 2018 07:48:58 -0700 Subject: [PATCH 09/13] Move RazorGenerate and RazorTagHelper tasks in to the Sdk Loading multiple versions of a task assembly result results in MSBuild on .NET Core to fail. Addressing this by moving the tasks in to the Sdk and renaming it. This should avoid immediate issues for a 2.1 and 2.2 project co-existing and future proofs 2.2 and later. Fixes https://github.com/aspnet/Razor/issues/2553 --- Razor.sln | 15 +- .../Microsoft.AspNetCore.Razor.Design.csproj | 16 +- ...etCore.Razor.Design.CodeGeneration.targets | 3 + .../Microsoft.AspNetCore.Razor.Design.props | 7 - .../Microsoft.AspNetCore.Razor.Tasks.csproj | 34 - .../DotnetToolTask.cs | 0 .../Microsoft.NET.Sdk.Razor.csproj | 31 +- .../RazorGenerate.cs | 0 .../RazorTagHelper.cs | 0 .../baseline.netcore.json | 762 ++++++++++++++++++ .../baseline.netframework.json | 762 ++++++++++++++++++ .../Sdk.Razor.CurrentVersion.targets | 9 +- .../IntegrationTests/BuildIntegrationTest.cs | 25 + ...rosoft.AspNetCore.Razor.Design.Test.csproj | 8 +- .../AppWithP2PReference.csproj | 15 + .../testapps/ClassLibrary/ClassLibrary.csproj | 15 + .../ClassLibrary2/ClassLibrary2.csproj | 15 + .../Areas/MyFeature/Pages/Page1.cshtml | 16 + .../Areas/MyFeature/Pages/Page1.cshtml.cs | 17 + .../ClassLibraryMvc21.csproj | 18 + test/testapps/Directory.Build.props | 20 +- .../testapps/LargeProject/LargeProject.csproj | 15 + test/testapps/SimpleMvc/SimpleMvc.csproj | 15 + .../SimpleMvcFSharp/SimpleMvcFSharp.fsproj | 15 + test/testapps/SimplePages/SimplePages.csproj | 15 + 25 files changed, 1757 insertions(+), 91 deletions(-) delete mode 100644 src/Microsoft.AspNetCore.Razor.Tasks/Microsoft.AspNetCore.Razor.Tasks.csproj rename src/{Microsoft.AspNetCore.Razor.Tasks => Microsoft.NET.Sdk.Razor}/DotnetToolTask.cs (100%) rename src/{Microsoft.AspNetCore.Razor.Tasks => Microsoft.NET.Sdk.Razor}/RazorGenerate.cs (100%) rename src/{Microsoft.AspNetCore.Razor.Tasks => Microsoft.NET.Sdk.Razor}/RazorTagHelper.cs (100%) create mode 100644 src/Microsoft.NET.Sdk.Razor/baseline.netcore.json create mode 100644 src/Microsoft.NET.Sdk.Razor/baseline.netframework.json create mode 100644 test/testapps/ClassLibraryMvc21/Areas/MyFeature/Pages/Page1.cshtml create mode 100644 test/testapps/ClassLibraryMvc21/Areas/MyFeature/Pages/Page1.cshtml.cs create mode 100644 test/testapps/ClassLibraryMvc21/ClassLibraryMvc21.csproj diff --git a/Razor.sln b/Razor.sln index 6ec8cff6c0..5bb3137be2 100644 --- a/Razor.sln +++ b/Razor.sln @@ -81,8 +81,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Razor. EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Razor.Design.Test", "test\Microsoft.AspNetCore.Razor.Design.Test\Microsoft.AspNetCore.Razor.Design.Test.csproj", "{1D90F276-E1CA-4FDF-A173-EB889E7D3150}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Razor.Tasks", "src\Microsoft.AspNetCore.Razor.Tasks\Microsoft.AspNetCore.Razor.Tasks.csproj", "{043B9497-C0BA-4770-9210-4456D2F81CE0}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Razor.Test", "test\Microsoft.AspNetCore.Razor.Test\Microsoft.AspNetCore.Razor.Test.csproj", "{323553F0-14AB-4FBD-9CF0-1CC0BE8056F8}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Razor.Performance", "benchmarks\Microsoft.AspNetCore.Razor.Performance\Microsoft.AspNetCore.Razor.Performance.csproj", "{6205467F-E381-4C42-AEEC-763BD62B3D5E}" @@ -345,14 +343,6 @@ Global {1D90F276-E1CA-4FDF-A173-EB889E7D3150}.Release|Any CPU.Build.0 = Release|Any CPU {1D90F276-E1CA-4FDF-A173-EB889E7D3150}.ReleaseNoVSIX|Any CPU.ActiveCfg = Release|Any CPU {1D90F276-E1CA-4FDF-A173-EB889E7D3150}.ReleaseNoVSIX|Any CPU.Build.0 = Release|Any CPU - {043B9497-C0BA-4770-9210-4456D2F81CE0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {043B9497-C0BA-4770-9210-4456D2F81CE0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {043B9497-C0BA-4770-9210-4456D2F81CE0}.DebugNoVSIX|Any CPU.ActiveCfg = Debug|Any CPU - {043B9497-C0BA-4770-9210-4456D2F81CE0}.DebugNoVSIX|Any CPU.Build.0 = Debug|Any CPU - {043B9497-C0BA-4770-9210-4456D2F81CE0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {043B9497-C0BA-4770-9210-4456D2F81CE0}.Release|Any CPU.Build.0 = Release|Any CPU - {043B9497-C0BA-4770-9210-4456D2F81CE0}.ReleaseNoVSIX|Any CPU.ActiveCfg = Release|Any CPU - {043B9497-C0BA-4770-9210-4456D2F81CE0}.ReleaseNoVSIX|Any CPU.Build.0 = Release|Any CPU {323553F0-14AB-4FBD-9CF0-1CC0BE8056F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {323553F0-14AB-4FBD-9CF0-1CC0BE8056F8}.Debug|Any CPU.Build.0 = Debug|Any CPU {323553F0-14AB-4FBD-9CF0-1CC0BE8056F8}.DebugNoVSIX|Any CPU.ActiveCfg = Debug|Any CPU @@ -391,8 +381,8 @@ Global {7D9ECCEE-71D1-4A42-ABEE-876AFA1B4FC9}.DebugNoVSIX|Any CPU.Build.0 = Debug|Any CPU {7D9ECCEE-71D1-4A42-ABEE-876AFA1B4FC9}.Release|Any CPU.ActiveCfg = Release|Any CPU {7D9ECCEE-71D1-4A42-ABEE-876AFA1B4FC9}.Release|Any CPU.Build.0 = Release|Any CPU - {7D9ECCEE-71D1-4A42-ABEE-876AFA1B4FC9}.ReleaseNoVSIX|Any CPU.ActiveCfg = Debug|Any CPU - {7D9ECCEE-71D1-4A42-ABEE-876AFA1B4FC9}.ReleaseNoVSIX|Any CPU.Build.0 = Debug|Any CPU + {7D9ECCEE-71D1-4A42-ABEE-876AFA1B4FC9}.ReleaseNoVSIX|Any CPU.ActiveCfg = Release|Any CPU + {7D9ECCEE-71D1-4A42-ABEE-876AFA1B4FC9}.ReleaseNoVSIX|Any CPU.Build.0 = Release|Any CPU {6EA56B2B-89EC-4C38-A384-97D203375B06}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {6EA56B2B-89EC-4C38-A384-97D203375B06}.Debug|Any CPU.Build.0 = Debug|Any CPU {6EA56B2B-89EC-4C38-A384-97D203375B06}.DebugNoVSIX|Any CPU.ActiveCfg = Debug|Any CPU @@ -444,7 +434,6 @@ Global {B8A3E4CA-D54A-441F-A3BF-E00F060CA042} = {92463391-81BE-462B-AC3C-78C6C760741F} {5257B25D-330A-4DCF-ACED-B4709CFBF916} = {3C0D6505-79B3-49D0-B4C3-176F0F1836ED} {1D90F276-E1CA-4FDF-A173-EB889E7D3150} = {92463391-81BE-462B-AC3C-78C6C760741F} - {043B9497-C0BA-4770-9210-4456D2F81CE0} = {3C0D6505-79B3-49D0-B4C3-176F0F1836ED} {323553F0-14AB-4FBD-9CF0-1CC0BE8056F8} = {92463391-81BE-462B-AC3C-78C6C760741F} {6205467F-E381-4C42-AEEC-763BD62B3D5E} = {C2C98051-0F39-47F2-80B6-E72B29159F2C} {933101DA-C4CC-401A-AA01-2784E1025B7F} = {92463391-81BE-462B-AC3C-78C6C760741F} diff --git a/src/Microsoft.AspNetCore.Razor.Design/Microsoft.AspNetCore.Razor.Design.csproj b/src/Microsoft.AspNetCore.Razor.Design/Microsoft.AspNetCore.Razor.Design.csproj index 2e248645a5..5a053d5f61 100644 --- a/src/Microsoft.AspNetCore.Razor.Design/Microsoft.AspNetCore.Razor.Design.csproj +++ b/src/Microsoft.AspNetCore.Razor.Design/Microsoft.AspNetCore.Razor.Design.csproj @@ -1,7 +1,7 @@  Razor is a markup syntax for adding server-side logic to web pages. This package contains MSBuild support for Razor. - netcoreapp2.0;net46 + netcoreapp2.0 false @@ -12,7 +12,7 @@ - - @@ -70,19 +66,13 @@ repositoryCommit=$(RepositoryCommit); copyright=$(Copyright); - - TaskAssemblyNet46=$(OutputPath)tasks\net46\$(TaskProject).dll; - TaskSymbolNet46=$(OutputPath)tasks\net46\$(TaskProject).pdb; - TaskAssemblyNetStandard=$(OutputPath)tasks\netstandard2.0\$(TaskProject).dll; - TaskSymbolNetStandard=$(OutputPath)tasks\netstandard2.0\$(TaskProject).pdb; - ToolFiles=$(OutputPath)tools\**\*; - + diff --git a/src/Microsoft.AspNetCore.Razor.Design/build/netstandard2.0/Microsoft.AspNetCore.Razor.Design.CodeGeneration.targets b/src/Microsoft.AspNetCore.Razor.Design/build/netstandard2.0/Microsoft.AspNetCore.Razor.Design.CodeGeneration.targets index 1eb7d2baad..374252655b 100644 --- a/src/Microsoft.AspNetCore.Razor.Design/build/netstandard2.0/Microsoft.AspNetCore.Razor.Design.CodeGeneration.targets +++ b/src/Microsoft.AspNetCore.Razor.Design/build/netstandard2.0/Microsoft.AspNetCore.Razor.Design.CodeGeneration.targets @@ -4,6 +4,9 @@ This target is explicitly imported by Razor SDK. --> + + + <_RazorMSBuildRoot Condition="'$(_RazorMSBuildRoot)'==''">$(MSBuildThisFileDirectory)..\..\ - <_RazorTaskFolder Condition=" '$(MSBuildRuntimeType)' == 'Core' ">netstandard2.0 - <_RazorTaskFolder Condition=" '$(MSBuildRuntimeType)' != 'Core' ">net46 - - <_RazorTaskAssembly Condition="'$(_RazorTaskAssembly)'==''">$(_RazorMSBuildRoot)\tasks\$(_RazorTaskFolder)\Microsoft.AspNetCore.Razor.Tasks.dll - <_RazorToolAssembly Condition="'$(_RazorToolAssembly)'==''">$(_RazorMSBuildRoot)tools\rzc.dll @@ -47,6 +42,4 @@ - - diff --git a/src/Microsoft.AspNetCore.Razor.Tasks/Microsoft.AspNetCore.Razor.Tasks.csproj b/src/Microsoft.AspNetCore.Razor.Tasks/Microsoft.AspNetCore.Razor.Tasks.csproj deleted file mode 100644 index c39999ba4c..0000000000 --- a/src/Microsoft.AspNetCore.Razor.Tasks/Microsoft.AspNetCore.Razor.Tasks.csproj +++ /dev/null @@ -1,34 +0,0 @@ - - - - Razor is a markup syntax for adding server-side logic to web pages. This assembly contains infrastructure supporting Razor MSBuild integration. - - - net46;netstandard2.0 - - - false - false - - ..\Microsoft.AspNetCore.Razor.Design\bin\$(Configuration)\tasks\ - - - - - - - - - Shared\ServerProtocol\%(FileName) - - - Shared\PipeName.cs - - - Shared\MutexName.cs - - - Shared\Client.cs - - - diff --git a/src/Microsoft.AspNetCore.Razor.Tasks/DotnetToolTask.cs b/src/Microsoft.NET.Sdk.Razor/DotnetToolTask.cs similarity index 100% rename from src/Microsoft.AspNetCore.Razor.Tasks/DotnetToolTask.cs rename to src/Microsoft.NET.Sdk.Razor/DotnetToolTask.cs diff --git a/src/Microsoft.NET.Sdk.Razor/Microsoft.NET.Sdk.Razor.csproj b/src/Microsoft.NET.Sdk.Razor/Microsoft.NET.Sdk.Razor.csproj index 95bb7fec04..a295f16f11 100644 --- a/src/Microsoft.NET.Sdk.Razor/Microsoft.NET.Sdk.Razor.csproj +++ b/src/Microsoft.NET.Sdk.Razor/Microsoft.NET.Sdk.Razor.csproj @@ -1,19 +1,38 @@ Razor is a markup syntax for adding server-side logic to web pages. This package contains MSBuild support for Razor. - netstandard2.0 + netstandard2.0;net46 - - false + Microsoft.NET.Sdk.Razor.Tasks + tasks - false - false + - + + + + + + + + + + Shared\ServerProtocol\%(FileName) + + + Shared\PipeName.cs + + + Shared\MutexName.cs + + + Shared\Client.cs + + diff --git a/src/Microsoft.AspNetCore.Razor.Tasks/RazorGenerate.cs b/src/Microsoft.NET.Sdk.Razor/RazorGenerate.cs similarity index 100% rename from src/Microsoft.AspNetCore.Razor.Tasks/RazorGenerate.cs rename to src/Microsoft.NET.Sdk.Razor/RazorGenerate.cs diff --git a/src/Microsoft.AspNetCore.Razor.Tasks/RazorTagHelper.cs b/src/Microsoft.NET.Sdk.Razor/RazorTagHelper.cs similarity index 100% rename from src/Microsoft.AspNetCore.Razor.Tasks/RazorTagHelper.cs rename to src/Microsoft.NET.Sdk.Razor/RazorTagHelper.cs diff --git a/src/Microsoft.NET.Sdk.Razor/baseline.netcore.json b/src/Microsoft.NET.Sdk.Razor/baseline.netcore.json new file mode 100644 index 0000000000..0443192d45 --- /dev/null +++ b/src/Microsoft.NET.Sdk.Razor/baseline.netcore.json @@ -0,0 +1,762 @@ +{ + "AssemblyIdentity": "Microsoft.AspNetCore.Razor.Tasks, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60", + "Types": [ + { + "Name": "Microsoft.AspNetCore.Razor.Tasks.DotNetToolTask", + "Visibility": "Public", + "Kind": "Class", + "Abstract": true, + "BaseType": "Microsoft.Build.Utilities.ToolTask", + "ImplementedInterfaces": [], + "Members": [ + { + "Kind": "Method", + "Name": "Execute", + "Parameters": [], + "ReturnType": "System.Boolean", + "Virtual": true, + "Override": true, + "ImplementedInterface": "Microsoft.Build.Framework.ITask", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "Cancel", + "Parameters": [], + "ReturnType": "System.Void", + "Virtual": true, + "Override": true, + "ImplementedInterface": "Microsoft.Build.Framework.ICancelableTask", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "get_Debug", + "Parameters": [], + "ReturnType": "System.Boolean", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "set_Debug", + "Parameters": [ + { + "Name": "value", + "Type": "System.Boolean" + } + ], + "ReturnType": "System.Void", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "get_DebugTool", + "Parameters": [], + "ReturnType": "System.Boolean", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "set_DebugTool", + "Parameters": [ + { + "Name": "value", + "Type": "System.Boolean" + } + ], + "ReturnType": "System.Void", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "get_ToolAssembly", + "Parameters": [], + "ReturnType": "System.String", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "set_ToolAssembly", + "Parameters": [ + { + "Name": "value", + "Type": "System.String" + } + ], + "ReturnType": "System.Void", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "get_UseServer", + "Parameters": [], + "ReturnType": "System.Boolean", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "set_UseServer", + "Parameters": [ + { + "Name": "value", + "Type": "System.Boolean" + } + ], + "ReturnType": "System.Void", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "get_ForceServer", + "Parameters": [], + "ReturnType": "System.Boolean", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "set_ForceServer", + "Parameters": [ + { + "Name": "value", + "Type": "System.Boolean" + } + ], + "ReturnType": "System.Void", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "get_SuppressCurrentUserOnlyPipeOptions", + "Parameters": [], + "ReturnType": "System.Boolean", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "set_SuppressCurrentUserOnlyPipeOptions", + "Parameters": [ + { + "Name": "value", + "Type": "System.Boolean" + } + ], + "ReturnType": "System.Void", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "get_PipeName", + "Parameters": [], + "ReturnType": "System.String", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "set_PipeName", + "Parameters": [ + { + "Name": "value", + "Type": "System.String" + } + ], + "ReturnType": "System.Void", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "get_ToolName", + "Parameters": [], + "ReturnType": "System.String", + "Virtual": true, + "Override": true, + "Visibility": "Protected", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "get_StandardOutputLoggingImportance", + "Parameters": [], + "ReturnType": "Microsoft.Build.Framework.MessageImportance", + "Virtual": true, + "Override": true, + "Visibility": "Protected", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "get_StandardErrorLoggingImportance", + "Parameters": [], + "ReturnType": "Microsoft.Build.Framework.MessageImportance", + "Virtual": true, + "Override": true, + "Visibility": "Protected", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "GenerateFullPathToTool", + "Parameters": [], + "ReturnType": "System.String", + "Virtual": true, + "Override": true, + "Visibility": "Protected", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "GenerateCommandLineCommands", + "Parameters": [], + "ReturnType": "System.String", + "Virtual": true, + "Override": true, + "Visibility": "Protected", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "GetResponseFileSwitch", + "Parameters": [ + { + "Name": "responseFilePath", + "Type": "System.String" + } + ], + "ReturnType": "System.String", + "Virtual": true, + "Override": true, + "Visibility": "Protected", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "GenerateResponseFileCommands", + "Parameters": [], + "ReturnType": "System.String", + "Virtual": true, + "Override": true, + "Abstract": true, + "Visibility": "Protected", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "ExecuteTool", + "Parameters": [ + { + "Name": "pathToTool", + "Type": "System.String" + }, + { + "Name": "responseFileCommands", + "Type": "System.String" + }, + { + "Name": "commandLineCommands", + "Type": "System.String" + } + ], + "ReturnType": "System.Int32", + "Virtual": true, + "Override": true, + "Visibility": "Protected", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "LogToolCommand", + "Parameters": [ + { + "Name": "message", + "Type": "System.String" + } + ], + "ReturnType": "System.Void", + "Virtual": true, + "Override": true, + "Visibility": "Protected", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "TryExecuteOnServer", + "Parameters": [ + { + "Name": "pathToTool", + "Type": "System.String" + }, + { + "Name": "responseFileCommands", + "Type": "System.String" + }, + { + "Name": "commandLineCommands", + "Type": "System.String" + }, + { + "Name": "result", + "Type": "System.Int32", + "Direction": "Out" + } + ], + "ReturnType": "System.Boolean", + "Virtual": true, + "Visibility": "Protected", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "HandleTaskExecutionErrors", + "Parameters": [], + "ReturnType": "System.Boolean", + "Virtual": true, + "Override": true, + "Visibility": "Protected", + "GenericParameter": [] + }, + { + "Kind": "Constructor", + "Name": ".ctor", + "Parameters": [], + "Visibility": "Protected", + "GenericParameter": [] + } + ], + "GenericParameters": [] + }, + { + "Name": "Microsoft.AspNetCore.Razor.Tasks.RazorGenerate", + "Visibility": "Public", + "Kind": "Class", + "BaseType": "Microsoft.AspNetCore.Razor.Tasks.DotNetToolTask", + "ImplementedInterfaces": [], + "Members": [ + { + "Kind": "Method", + "Name": "get_Version", + "Parameters": [], + "ReturnType": "System.String", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "set_Version", + "Parameters": [ + { + "Name": "value", + "Type": "System.String" + } + ], + "ReturnType": "System.Void", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "get_Configuration", + "Parameters": [], + "ReturnType": "Microsoft.Build.Framework.ITaskItem[]", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "set_Configuration", + "Parameters": [ + { + "Name": "value", + "Type": "Microsoft.Build.Framework.ITaskItem[]" + } + ], + "ReturnType": "System.Void", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "get_Extensions", + "Parameters": [], + "ReturnType": "Microsoft.Build.Framework.ITaskItem[]", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "set_Extensions", + "Parameters": [ + { + "Name": "value", + "Type": "Microsoft.Build.Framework.ITaskItem[]" + } + ], + "ReturnType": "System.Void", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "get_Sources", + "Parameters": [], + "ReturnType": "Microsoft.Build.Framework.ITaskItem[]", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "set_Sources", + "Parameters": [ + { + "Name": "value", + "Type": "Microsoft.Build.Framework.ITaskItem[]" + } + ], + "ReturnType": "System.Void", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "get_ProjectRoot", + "Parameters": [], + "ReturnType": "System.String", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "set_ProjectRoot", + "Parameters": [ + { + "Name": "value", + "Type": "System.String" + } + ], + "ReturnType": "System.Void", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "get_TagHelperManifest", + "Parameters": [], + "ReturnType": "System.String", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "set_TagHelperManifest", + "Parameters": [ + { + "Name": "value", + "Type": "System.String" + } + ], + "ReturnType": "System.Void", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "ValidateParameters", + "Parameters": [], + "ReturnType": "System.Boolean", + "Virtual": true, + "Override": true, + "Visibility": "Protected", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "GenerateResponseFileCommands", + "Parameters": [], + "ReturnType": "System.String", + "Virtual": true, + "Override": true, + "Visibility": "Protected", + "GenericParameter": [] + }, + { + "Kind": "Constructor", + "Name": ".ctor", + "Parameters": [], + "Visibility": "Public", + "GenericParameter": [] + } + ], + "GenericParameters": [] + }, + { + "Name": "Microsoft.AspNetCore.Razor.Tasks.RazorTagHelper", + "Visibility": "Public", + "Kind": "Class", + "BaseType": "Microsoft.AspNetCore.Razor.Tasks.DotNetToolTask", + "ImplementedInterfaces": [], + "Members": [ + { + "Kind": "Method", + "Name": "get_Version", + "Parameters": [], + "ReturnType": "System.String", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "set_Version", + "Parameters": [ + { + "Name": "value", + "Type": "System.String" + } + ], + "ReturnType": "System.Void", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "get_Configuration", + "Parameters": [], + "ReturnType": "Microsoft.Build.Framework.ITaskItem[]", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "set_Configuration", + "Parameters": [ + { + "Name": "value", + "Type": "Microsoft.Build.Framework.ITaskItem[]" + } + ], + "ReturnType": "System.Void", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "get_Extensions", + "Parameters": [], + "ReturnType": "Microsoft.Build.Framework.ITaskItem[]", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "set_Extensions", + "Parameters": [ + { + "Name": "value", + "Type": "Microsoft.Build.Framework.ITaskItem[]" + } + ], + "ReturnType": "System.Void", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "get_Assemblies", + "Parameters": [], + "ReturnType": "System.String[]", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "set_Assemblies", + "Parameters": [ + { + "Name": "value", + "Type": "System.String[]" + } + ], + "ReturnType": "System.Void", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "get_TagHelperManifest", + "Parameters": [], + "ReturnType": "System.String", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "set_TagHelperManifest", + "Parameters": [ + { + "Name": "value", + "Type": "System.String" + } + ], + "ReturnType": "System.Void", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "get_ProjectRoot", + "Parameters": [], + "ReturnType": "System.String", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "set_ProjectRoot", + "Parameters": [ + { + "Name": "value", + "Type": "System.String" + } + ], + "ReturnType": "System.Void", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "SkipTaskExecution", + "Parameters": [], + "ReturnType": "System.Boolean", + "Virtual": true, + "Override": true, + "Visibility": "Protected", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "ValidateParameters", + "Parameters": [], + "ReturnType": "System.Boolean", + "Virtual": true, + "Override": true, + "Visibility": "Protected", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "GenerateResponseFileCommands", + "Parameters": [], + "ReturnType": "System.String", + "Virtual": true, + "Override": true, + "Visibility": "Protected", + "GenericParameter": [] + }, + { + "Kind": "Constructor", + "Name": ".ctor", + "Parameters": [], + "Visibility": "Public", + "GenericParameter": [] + } + ], + "GenericParameters": [] + }, + { + "Name": "Microsoft.AspNetCore.Razor.Tools.RequestArgument+ArgumentId", + "Visibility": "Public", + "Kind": "Enumeration", + "Sealed": true, + "ImplementedInterfaces": [], + "Members": [ + { + "Kind": "Field", + "Name": "CurrentDirectory", + "Parameters": [], + "GenericParameter": [], + "Literal": "1360294433" + }, + { + "Kind": "Field", + "Name": "CommandLineArgument", + "Parameters": [], + "GenericParameter": [], + "Literal": "1360294434" + }, + { + "Kind": "Field", + "Name": "KeepAlive", + "Parameters": [], + "GenericParameter": [], + "Literal": "1360294435" + }, + { + "Kind": "Field", + "Name": "Shutdown", + "Parameters": [], + "GenericParameter": [], + "Literal": "1360294436" + }, + { + "Kind": "Field", + "Name": "TempDirectory", + "Parameters": [], + "GenericParameter": [], + "Literal": "1360294437" + } + ], + "GenericParameters": [] + }, + { + "Name": "Microsoft.AspNetCore.Razor.Tools.ServerResponse+ResponseType", + "Visibility": "Public", + "Kind": "Enumeration", + "Sealed": true, + "ImplementedInterfaces": [], + "Members": [ + { + "Kind": "Field", + "Name": "MismatchedVersion", + "Parameters": [], + "GenericParameter": [], + "Literal": "0" + }, + { + "Kind": "Field", + "Name": "Completed", + "Parameters": [], + "GenericParameter": [], + "Literal": "1" + }, + { + "Kind": "Field", + "Name": "Shutdown", + "Parameters": [], + "GenericParameter": [], + "Literal": "2" + }, + { + "Kind": "Field", + "Name": "Rejected", + "Parameters": [], + "GenericParameter": [], + "Literal": "3" + } + ], + "GenericParameters": [] + } + ] +} \ No newline at end of file diff --git a/src/Microsoft.NET.Sdk.Razor/baseline.netframework.json b/src/Microsoft.NET.Sdk.Razor/baseline.netframework.json new file mode 100644 index 0000000000..4cec036ca8 --- /dev/null +++ b/src/Microsoft.NET.Sdk.Razor/baseline.netframework.json @@ -0,0 +1,762 @@ +{ + "AssemblyIdentity": "Microsoft.AspNetCore.Razor.Tasks, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60", + "Types": [ + { + "Name": "Microsoft.AspNetCore.Razor.Tasks.DotNetToolTask", + "Visibility": "Public", + "Kind": "Class", + "Abstract": true, + "BaseType": "Microsoft.Build.Utilities.ToolTask", + "ImplementedInterfaces": [], + "Members": [ + { + "Kind": "Method", + "Name": "get_Debug", + "Parameters": [], + "ReturnType": "System.Boolean", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "set_Debug", + "Parameters": [ + { + "Name": "value", + "Type": "System.Boolean" + } + ], + "ReturnType": "System.Void", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "get_DebugTool", + "Parameters": [], + "ReturnType": "System.Boolean", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "set_DebugTool", + "Parameters": [ + { + "Name": "value", + "Type": "System.Boolean" + } + ], + "ReturnType": "System.Void", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "get_ToolAssembly", + "Parameters": [], + "ReturnType": "System.String", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "set_ToolAssembly", + "Parameters": [ + { + "Name": "value", + "Type": "System.String" + } + ], + "ReturnType": "System.Void", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "get_UseServer", + "Parameters": [], + "ReturnType": "System.Boolean", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "set_UseServer", + "Parameters": [ + { + "Name": "value", + "Type": "System.Boolean" + } + ], + "ReturnType": "System.Void", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "get_ForceServer", + "Parameters": [], + "ReturnType": "System.Boolean", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "set_ForceServer", + "Parameters": [ + { + "Name": "value", + "Type": "System.Boolean" + } + ], + "ReturnType": "System.Void", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "get_SuppressCurrentUserOnlyPipeOptions", + "Parameters": [], + "ReturnType": "System.Boolean", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "set_SuppressCurrentUserOnlyPipeOptions", + "Parameters": [ + { + "Name": "value", + "Type": "System.Boolean" + } + ], + "ReturnType": "System.Void", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "get_PipeName", + "Parameters": [], + "ReturnType": "System.String", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "set_PipeName", + "Parameters": [ + { + "Name": "value", + "Type": "System.String" + } + ], + "ReturnType": "System.Void", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "get_ToolName", + "Parameters": [], + "ReturnType": "System.String", + "Virtual": true, + "Override": true, + "Visibility": "Protected", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "get_StandardOutputLoggingImportance", + "Parameters": [], + "ReturnType": "Microsoft.Build.Framework.MessageImportance", + "Virtual": true, + "Override": true, + "Visibility": "Protected", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "get_StandardErrorLoggingImportance", + "Parameters": [], + "ReturnType": "Microsoft.Build.Framework.MessageImportance", + "Virtual": true, + "Override": true, + "Visibility": "Protected", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "GenerateFullPathToTool", + "Parameters": [], + "ReturnType": "System.String", + "Virtual": true, + "Override": true, + "Visibility": "Protected", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "GenerateCommandLineCommands", + "Parameters": [], + "ReturnType": "System.String", + "Virtual": true, + "Override": true, + "Visibility": "Protected", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "GetResponseFileSwitch", + "Parameters": [ + { + "Name": "responseFilePath", + "Type": "System.String" + } + ], + "ReturnType": "System.String", + "Virtual": true, + "Override": true, + "Visibility": "Protected", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "GenerateResponseFileCommands", + "Parameters": [], + "ReturnType": "System.String", + "Virtual": true, + "Override": true, + "Abstract": true, + "Visibility": "Protected", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "Execute", + "Parameters": [], + "ReturnType": "System.Boolean", + "Virtual": true, + "Override": true, + "ImplementedInterface": "Microsoft.Build.Framework.ITask", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "ExecuteTool", + "Parameters": [ + { + "Name": "pathToTool", + "Type": "System.String" + }, + { + "Name": "responseFileCommands", + "Type": "System.String" + }, + { + "Name": "commandLineCommands", + "Type": "System.String" + } + ], + "ReturnType": "System.Int32", + "Virtual": true, + "Override": true, + "Visibility": "Protected", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "LogToolCommand", + "Parameters": [ + { + "Name": "message", + "Type": "System.String" + } + ], + "ReturnType": "System.Void", + "Virtual": true, + "Override": true, + "Visibility": "Protected", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "Cancel", + "Parameters": [], + "ReturnType": "System.Void", + "Virtual": true, + "Override": true, + "ImplementedInterface": "Microsoft.Build.Framework.ICancelableTask", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "TryExecuteOnServer", + "Parameters": [ + { + "Name": "pathToTool", + "Type": "System.String" + }, + { + "Name": "responseFileCommands", + "Type": "System.String" + }, + { + "Name": "commandLineCommands", + "Type": "System.String" + }, + { + "Name": "result", + "Type": "System.Int32", + "Direction": "Out" + } + ], + "ReturnType": "System.Boolean", + "Virtual": true, + "Visibility": "Protected", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "HandleTaskExecutionErrors", + "Parameters": [], + "ReturnType": "System.Boolean", + "Virtual": true, + "Override": true, + "Visibility": "Protected", + "GenericParameter": [] + }, + { + "Kind": "Constructor", + "Name": ".ctor", + "Parameters": [], + "Visibility": "Protected", + "GenericParameter": [] + } + ], + "GenericParameters": [] + }, + { + "Name": "Microsoft.AspNetCore.Razor.Tasks.RazorGenerate", + "Visibility": "Public", + "Kind": "Class", + "BaseType": "Microsoft.AspNetCore.Razor.Tasks.DotNetToolTask", + "ImplementedInterfaces": [], + "Members": [ + { + "Kind": "Method", + "Name": "get_Version", + "Parameters": [], + "ReturnType": "System.String", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "set_Version", + "Parameters": [ + { + "Name": "value", + "Type": "System.String" + } + ], + "ReturnType": "System.Void", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "get_Configuration", + "Parameters": [], + "ReturnType": "Microsoft.Build.Framework.ITaskItem[]", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "set_Configuration", + "Parameters": [ + { + "Name": "value", + "Type": "Microsoft.Build.Framework.ITaskItem[]" + } + ], + "ReturnType": "System.Void", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "get_Extensions", + "Parameters": [], + "ReturnType": "Microsoft.Build.Framework.ITaskItem[]", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "set_Extensions", + "Parameters": [ + { + "Name": "value", + "Type": "Microsoft.Build.Framework.ITaskItem[]" + } + ], + "ReturnType": "System.Void", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "get_Sources", + "Parameters": [], + "ReturnType": "Microsoft.Build.Framework.ITaskItem[]", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "set_Sources", + "Parameters": [ + { + "Name": "value", + "Type": "Microsoft.Build.Framework.ITaskItem[]" + } + ], + "ReturnType": "System.Void", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "get_ProjectRoot", + "Parameters": [], + "ReturnType": "System.String", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "set_ProjectRoot", + "Parameters": [ + { + "Name": "value", + "Type": "System.String" + } + ], + "ReturnType": "System.Void", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "get_TagHelperManifest", + "Parameters": [], + "ReturnType": "System.String", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "set_TagHelperManifest", + "Parameters": [ + { + "Name": "value", + "Type": "System.String" + } + ], + "ReturnType": "System.Void", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "ValidateParameters", + "Parameters": [], + "ReturnType": "System.Boolean", + "Virtual": true, + "Override": true, + "Visibility": "Protected", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "GenerateResponseFileCommands", + "Parameters": [], + "ReturnType": "System.String", + "Virtual": true, + "Override": true, + "Visibility": "Protected", + "GenericParameter": [] + }, + { + "Kind": "Constructor", + "Name": ".ctor", + "Parameters": [], + "Visibility": "Public", + "GenericParameter": [] + } + ], + "GenericParameters": [] + }, + { + "Name": "Microsoft.AspNetCore.Razor.Tasks.RazorTagHelper", + "Visibility": "Public", + "Kind": "Class", + "BaseType": "Microsoft.AspNetCore.Razor.Tasks.DotNetToolTask", + "ImplementedInterfaces": [], + "Members": [ + { + "Kind": "Method", + "Name": "get_Version", + "Parameters": [], + "ReturnType": "System.String", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "set_Version", + "Parameters": [ + { + "Name": "value", + "Type": "System.String" + } + ], + "ReturnType": "System.Void", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "get_Configuration", + "Parameters": [], + "ReturnType": "Microsoft.Build.Framework.ITaskItem[]", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "set_Configuration", + "Parameters": [ + { + "Name": "value", + "Type": "Microsoft.Build.Framework.ITaskItem[]" + } + ], + "ReturnType": "System.Void", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "get_Extensions", + "Parameters": [], + "ReturnType": "Microsoft.Build.Framework.ITaskItem[]", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "set_Extensions", + "Parameters": [ + { + "Name": "value", + "Type": "Microsoft.Build.Framework.ITaskItem[]" + } + ], + "ReturnType": "System.Void", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "get_Assemblies", + "Parameters": [], + "ReturnType": "System.String[]", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "set_Assemblies", + "Parameters": [ + { + "Name": "value", + "Type": "System.String[]" + } + ], + "ReturnType": "System.Void", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "get_TagHelperManifest", + "Parameters": [], + "ReturnType": "System.String", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "set_TagHelperManifest", + "Parameters": [ + { + "Name": "value", + "Type": "System.String" + } + ], + "ReturnType": "System.Void", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "get_ProjectRoot", + "Parameters": [], + "ReturnType": "System.String", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "set_ProjectRoot", + "Parameters": [ + { + "Name": "value", + "Type": "System.String" + } + ], + "ReturnType": "System.Void", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "SkipTaskExecution", + "Parameters": [], + "ReturnType": "System.Boolean", + "Virtual": true, + "Override": true, + "Visibility": "Protected", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "ValidateParameters", + "Parameters": [], + "ReturnType": "System.Boolean", + "Virtual": true, + "Override": true, + "Visibility": "Protected", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "GenerateResponseFileCommands", + "Parameters": [], + "ReturnType": "System.String", + "Virtual": true, + "Override": true, + "Visibility": "Protected", + "GenericParameter": [] + }, + { + "Kind": "Constructor", + "Name": ".ctor", + "Parameters": [], + "Visibility": "Public", + "GenericParameter": [] + } + ], + "GenericParameters": [] + }, + { + "Name": "Microsoft.AspNetCore.Razor.Tools.RequestArgument+ArgumentId", + "Visibility": "Public", + "Kind": "Enumeration", + "Sealed": true, + "ImplementedInterfaces": [], + "Members": [ + { + "Kind": "Field", + "Name": "CurrentDirectory", + "Parameters": [], + "GenericParameter": [], + "Literal": "1360294433" + }, + { + "Kind": "Field", + "Name": "CommandLineArgument", + "Parameters": [], + "GenericParameter": [], + "Literal": "1360294434" + }, + { + "Kind": "Field", + "Name": "KeepAlive", + "Parameters": [], + "GenericParameter": [], + "Literal": "1360294435" + }, + { + "Kind": "Field", + "Name": "Shutdown", + "Parameters": [], + "GenericParameter": [], + "Literal": "1360294436" + }, + { + "Kind": "Field", + "Name": "TempDirectory", + "Parameters": [], + "GenericParameter": [], + "Literal": "1360294437" + } + ], + "GenericParameters": [] + }, + { + "Name": "Microsoft.AspNetCore.Razor.Tools.ServerResponse+ResponseType", + "Visibility": "Public", + "Kind": "Enumeration", + "Sealed": true, + "ImplementedInterfaces": [], + "Members": [ + { + "Kind": "Field", + "Name": "MismatchedVersion", + "Parameters": [], + "GenericParameter": [], + "Literal": "0" + }, + { + "Kind": "Field", + "Name": "Completed", + "Parameters": [], + "GenericParameter": [], + "Literal": "1" + }, + { + "Kind": "Field", + "Name": "Shutdown", + "Parameters": [], + "GenericParameter": [], + "Literal": "2" + }, + { + "Kind": "Field", + "Name": "Rejected", + "Parameters": [], + "GenericParameter": [], + "Literal": "3" + } + ], + "GenericParameters": [] + } + ] +} \ No newline at end of file diff --git a/src/Microsoft.NET.Sdk.Razor/build/netstandard2.0/Sdk.Razor.CurrentVersion.targets b/src/Microsoft.NET.Sdk.Razor/build/netstandard2.0/Sdk.Razor.CurrentVersion.targets index 885d21988d..1790ba588d 100644 --- a/src/Microsoft.NET.Sdk.Razor/build/netstandard2.0/Sdk.Razor.CurrentVersion.targets +++ b/src/Microsoft.NET.Sdk.Razor/build/netstandard2.0/Sdk.Razor.CurrentVersion.targets @@ -9,7 +9,7 @@ WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and Copyright (c) .NET Foundation. All rights reserved. *********************************************************************************************** --> - + + + $(MSBuildThisFileDirectory)..\..\tasks\ + <_RazorSdkTasksTFM Condition=" '$(MSBuildRuntimeType)' == 'Core'">netstandard2.0 + <_RazorSdkTasksTFM Condition=" '$(_RazorSdkTasksTFM)' == ''">net46 + $(RazorSdkBuildTasksDirectoryRoot)$(_RazorSdkTasksTFM)\Microsoft.NET.Sdk.Razor.Tasks.dll + + + + + + + + + + + + + + diff --git a/test/testapps/ClassLibrary/ClassLibrary.csproj b/test/testapps/ClassLibrary/ClassLibrary.csproj index 6272fc2497..69d5f1b5d7 100644 --- a/test/testapps/ClassLibrary/ClassLibrary.csproj +++ b/test/testapps/ClassLibrary/ClassLibrary.csproj @@ -2,6 +2,7 @@ <_RazorMSBuildRoot>$(SolutionRoot)src\Microsoft.AspNetCore.Razor.Design\bin\$(Configuration)\ + $(RazorSdkProjectDirectory)bin\$(Configuration)\ @@ -26,6 +27,20 @@ false + + + + + + + + + + + + + + diff --git a/test/testapps/ClassLibrary2/ClassLibrary2.csproj b/test/testapps/ClassLibrary2/ClassLibrary2.csproj index 5a75754ff9..c31808dea6 100644 --- a/test/testapps/ClassLibrary2/ClassLibrary2.csproj +++ b/test/testapps/ClassLibrary2/ClassLibrary2.csproj @@ -2,6 +2,7 @@ <_RazorMSBuildRoot>$(SolutionRoot)src\Microsoft.AspNetCore.Razor.Design\bin\$(Configuration)\ + $(RazorSdkProjectDirectory)bin\$(Configuration)\ @@ -25,6 +26,20 @@ + + + + + + + + + + + + + + diff --git a/test/testapps/ClassLibraryMvc21/Areas/MyFeature/Pages/Page1.cshtml b/test/testapps/ClassLibraryMvc21/Areas/MyFeature/Pages/Page1.cshtml new file mode 100644 index 0000000000..69112690e7 --- /dev/null +++ b/test/testapps/ClassLibraryMvc21/Areas/MyFeature/Pages/Page1.cshtml @@ -0,0 +1,16 @@ +@page +@model ClassLibraryMvc21.MyFeature.Pages.Page1Model +@{ + Layout = null; +} + + + + + + + Page1 + + + + diff --git a/test/testapps/ClassLibraryMvc21/Areas/MyFeature/Pages/Page1.cshtml.cs b/test/testapps/ClassLibraryMvc21/Areas/MyFeature/Pages/Page1.cshtml.cs new file mode 100644 index 0000000000..c1fe87da2d --- /dev/null +++ b/test/testapps/ClassLibraryMvc21/Areas/MyFeature/Pages/Page1.cshtml.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.RazorPages; + +namespace ClassLibraryMvc21.MyFeature.Pages +{ + public class Page1Model : PageModel + { + public void OnGet() + { + + } + } +} \ No newline at end of file diff --git a/test/testapps/ClassLibraryMvc21/ClassLibraryMvc21.csproj b/test/testapps/ClassLibraryMvc21/ClassLibraryMvc21.csproj new file mode 100644 index 0000000000..04fdcf55f3 --- /dev/null +++ b/test/testapps/ClassLibraryMvc21/ClassLibraryMvc21.csproj @@ -0,0 +1,18 @@ + + + + + + netstandard2.0 + + + + + + All + + + diff --git a/test/testapps/Directory.Build.props b/test/testapps/Directory.Build.props index a716d247ec..ad571d2510 100644 --- a/test/testapps/Directory.Build.props +++ b/test/testapps/Directory.Build.props @@ -6,8 +6,10 @@ $([MSBuild]::EnsureTrailingSlash('$(SolutionRoot)')) - $(SolutionRoot)src\Microsoft.NET.Sdk.Razor\build\netstandard2.0\Sdk.Razor.CurrentVersion.props - $(SolutionRoot)src\Microsoft.NET.Sdk.Razor\build\netstandard2.0\Sdk.Razor.CurrentVersion.targets + $(SolutionRoot)src\Microsoft.NET.Sdk.Razor\ + + $(RazorSdkProjectDirectory)build\netstandard2.0\Sdk.Razor.CurrentVersion.props + $(RazorSdkProjectDirectory)build\netstandard2.0\Sdk.Razor.CurrentVersion.targets @@ -25,20 +27,6 @@ false - - - - - - - - - - - - - - diff --git a/test/testapps/LargeProject/LargeProject.csproj b/test/testapps/LargeProject/LargeProject.csproj index d9294ef631..8e7d83c73f 100644 --- a/test/testapps/LargeProject/LargeProject.csproj +++ b/test/testapps/LargeProject/LargeProject.csproj @@ -2,6 +2,7 @@ <_RazorMSBuildRoot>$(SolutionRoot)src\Microsoft.AspNetCore.Razor.Design\bin\$(Configuration)\ + $(RazorSdkProjectDirectory)bin\$(Configuration)\ @@ -21,6 +22,20 @@ false + + + + + + + + + + + + + + diff --git a/test/testapps/SimpleMvc/SimpleMvc.csproj b/test/testapps/SimpleMvc/SimpleMvc.csproj index de6a1dd665..22b0730b7a 100644 --- a/test/testapps/SimpleMvc/SimpleMvc.csproj +++ b/test/testapps/SimpleMvc/SimpleMvc.csproj @@ -2,6 +2,7 @@ <_RazorMSBuildRoot>$(SolutionRoot)src\Microsoft.AspNetCore.Razor.Design\bin\$(Configuration)\ + $(RazorSdkProjectDirectory)bin\$(Configuration)\ @@ -21,6 +22,20 @@ false + + + + + + + + + + + + + + diff --git a/test/testapps/SimpleMvcFSharp/SimpleMvcFSharp.fsproj b/test/testapps/SimpleMvcFSharp/SimpleMvcFSharp.fsproj index 27a307f6d6..e15be7467f 100644 --- a/test/testapps/SimpleMvcFSharp/SimpleMvcFSharp.fsproj +++ b/test/testapps/SimpleMvcFSharp/SimpleMvcFSharp.fsproj @@ -2,6 +2,7 @@ <_RazorMSBuildRoot>$(SolutionRoot)src\Microsoft.AspNetCore.Razor.Design\bin\$(Configuration)\ + $(RazorSdkProjectDirectory)bin\$(Configuration)\ @@ -26,6 +27,20 @@ + + + + + + + + + + + + + + diff --git a/test/testapps/SimplePages/SimplePages.csproj b/test/testapps/SimplePages/SimplePages.csproj index d9294ef631..292a128c5a 100644 --- a/test/testapps/SimplePages/SimplePages.csproj +++ b/test/testapps/SimplePages/SimplePages.csproj @@ -2,6 +2,7 @@ <_RazorMSBuildRoot>$(SolutionRoot)src\Microsoft.AspNetCore.Razor.Design\bin\$(Configuration)\ + $(RazorSdkProjectDirectory)bin\$(Configuration)\ @@ -21,6 +22,20 @@ false + + + + + + + + + + + + + + From a898f98a7f8b055ef5a1dda32a58b1b9631ca3a9 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Thu, 20 Sep 2018 12:41:06 -0700 Subject: [PATCH 10/13] Print an error when using Razor build with an older version of the Sdk --- ...etCore.Razor.Design.CodeGeneration.targets | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/Microsoft.AspNetCore.Razor.Design/build/netstandard2.0/Microsoft.AspNetCore.Razor.Design.CodeGeneration.targets b/src/Microsoft.AspNetCore.Razor.Design/build/netstandard2.0/Microsoft.AspNetCore.Razor.Design.CodeGeneration.targets index 374252655b..c81d741e1f 100644 --- a/src/Microsoft.AspNetCore.Razor.Design/build/netstandard2.0/Microsoft.AspNetCore.Razor.Design.CodeGeneration.targets +++ b/src/Microsoft.AspNetCore.Razor.Design/build/netstandard2.0/Microsoft.AspNetCore.Razor.Design.CodeGeneration.targets @@ -4,8 +4,15 @@ This target is explicitly imported by Razor SDK. --> - - + + + - - - + - + - - - - + + + + From 864a17c9a51bbf6c76af9c6f65b5d70f91025dea Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Fri, 28 Sep 2018 17:10:38 -0700 Subject: [PATCH 13/13] automated: bulk infrastructure updates. Update bootstrapper scripts and remove unnecessary signing properties --- Directory.Build.props | 3 --- run.ps1 | 6 +++--- run.sh | 10 +++++----- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 5e4bd6b937..220748df5f 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -14,10 +14,7 @@ $(MSBuildThisFileDirectory) $(MSBuildThisFileDirectory)build\Key.snk true - MicrosoftNuGet - true true - Microsoft 7.3 diff --git a/run.ps1 b/run.ps1 index 3b27382468..34604c7175 100644 --- a/run.ps1 +++ b/run.ps1 @@ -52,8 +52,8 @@ in the file are overridden by command line parameters. Example config file: ```json { - "$schema": "https://raw.githubusercontent.com/aspnet/BuildTools/dev/tools/korebuild.schema.json", - "channel": "dev", + "$schema": "https://raw.githubusercontent.com/aspnet/BuildTools/master/tools/korebuild.schema.json", + "channel": "master", "toolsSource": "https://aspnetcore.blob.core.windows.net/buildtools" } ``` @@ -192,7 +192,7 @@ if (!$DotNetHome) { else { Join-Path $PSScriptRoot '.dotnet'} } -if (!$Channel) { $Channel = 'dev' } +if (!$Channel) { $Channel = 'master' } if (!$ToolsSource) { $ToolsSource = 'https://aspnetcore.blob.core.windows.net/buildtools' } # Execute diff --git a/run.sh b/run.sh index 02aac15874..4c1fed5646 100755 --- a/run.sh +++ b/run.sh @@ -220,7 +220,7 @@ if [ -f "$config_file" ]; then config_channel="$(jq -r 'select(.channel!=null) | .channel' "$config_file")" config_tools_source="$(jq -r 'select(.toolsSource!=null) | .toolsSource' "$config_file")" else - _error "$config_file contains invalid JSON." + __error "$config_file contains invalid JSON." exit 1 fi elif __machine_has python ; then @@ -228,7 +228,7 @@ if [ -f "$config_file" ]; then config_channel="$(python -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'));print(obj['channel'] if 'channel' in obj else '')")" config_tools_source="$(python -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'));print(obj['toolsSource'] if 'toolsSource' in obj else '')")" else - _error "$config_file contains invalid JSON." + __error "$config_file contains invalid JSON." exit 1 fi elif __machine_has python3 ; then @@ -236,11 +236,11 @@ if [ -f "$config_file" ]; then config_channel="$(python3 -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'));print(obj['channel'] if 'channel' in obj else '')")" config_tools_source="$(python3 -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'));print(obj['toolsSource'] if 'toolsSource' in obj else '')")" else - _error "$config_file contains invalid JSON." + __error "$config_file contains invalid JSON." exit 1 fi else - _error 'Missing required command: jq or python. Could not parse the JSON file.' + __error 'Missing required command: jq or python. Could not parse the JSON file.' exit 1 fi @@ -248,7 +248,7 @@ if [ -f "$config_file" ]; then [ ! -z "${config_tools_source:-}" ] && tools_source="$config_tools_source" fi -[ -z "$channel" ] && channel='dev' +[ -z "$channel" ] && channel='master' [ -z "$tools_source" ] && tools_source='https://aspnetcore.blob.core.windows.net/buildtools' get_korebuild