From 514fcdcba533eb70a670b9ccc2073d67f6c6f9ca Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Fri, 16 Nov 2018 10:09:24 -0800 Subject: [PATCH] React to breaking changes in Microsoft.AspNetCore.App (aspnet/Templating#836) Changes: * Add packages references for EF Core, when necessary * Add packages references for SpaServices to Spa templates * Remove PackageReference to Microsoft.AspNetCore.App altogether See aspnet/AspNetCore#3612 for more context --- Directory.Build.props | 4 ++ build/dependencies.props | 44 +++++++------------ .../EmptyWeb-CSharp.csproj.in | 4 -- .../EmptyWeb-FSharp.fsproj.in | 4 -- ...crosoft.DotNet.Web.ProjectTemplates.csproj | 9 +--- .../RazorClassLibrary-CSharp.csproj.in | 5 ++- .../RazorPagesWeb-CSharp.csproj.in | 8 +++- .../StarterWeb-CSharp.csproj.in | 8 +++- .../StarterWeb-FSharp.fsproj.in | 4 -- .../WebApi-CSharp.csproj.in | 3 +- .../WebApi-FSharp.fsproj.in | 4 -- .../Angular-CSharp.csproj.in | 2 +- ...oft.DotNet.Web.Spa.ProjectTemplates.csproj | 5 --- .../React-CSharp.csproj.in | 2 +- .../ReactRedux-CSharp.csproj.in | 2 +- .../Helpers/TemplateTestBase.cs | 10 ++++- 16 files changed, 50 insertions(+), 68 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 92ebf42..dc99bb5 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -14,4 +14,8 @@ git true + + + + diff --git a/build/dependencies.props b/build/dependencies.props index 7673942..cc2d436 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -4,35 +4,25 @@ 0.9.9 - 3.0.0-alpha1-10620 + 3.0.0-preview-181109-02 3.0.0-alpha1-20181017.4 - 3.0.0-alpha1-10620 - 3.0.0-alpha1-10620 - 3.0.0-alpha1-10620 - 3.0.0-alpha1-10620 - 3.0.0-alpha1-10620 - 3.0.0-alpha1-10620 - 3.0.0-alpha1-10620 - 3.0.0-alpha1-10620 - 3.0.0-alpha1-10620 - 3.0.0-alpha1-10620 - 3.0.0-alpha1-10620 - 3.0.0-alpha1-10620 - 3.0.0-alpha1-10620 - 3.0.0-alpha1-10620 - 3.0.0-alpha1-10620 - 3.0.0-alpha1-10620 - 3.0.0-alpha1-10620 - 3.0.0-alpha1-10620 - 15.6.82 - 15.6.82 - 3.0.0-alpha1-10620 - 3.0.0-alpha1-10620 - 3.0.0-alpha1-10620 - 3.0.0-alpha1-10620 - 3.0.0-alpha1-10620 + 3.0.0-alpha1-10742 + 3.0.0-alpha1-10742 + 3.0.0-alpha1-10742 + 3.0.0-preview-181113-11 + 3.0.0-alpha1-10742 + 3.0.0-alpha1-10742 + 3.0.0-alpha1-10742 + 3.0.0-alpha1-10742 + 3.0.0-alpha1-10742 + 3.0.0-preview-181113-11 + 3.0.0-preview-181109-02 + 3.0.0-preview-181109-02 + 3.0.0-preview-181109-02 + 3.0.0-preview-181113-11 + 3.0.0-preview-181113-11 3.0.0-preview1-26907-05 - 3.0.0-alpha1-10620 + 3.0.0-alpha1-10742 15.6.1 2.0.3 3.12.1 diff --git a/src/Microsoft.DotNet.Web.ProjectTemplates/EmptyWeb-CSharp.csproj.in b/src/Microsoft.DotNet.Web.ProjectTemplates/EmptyWeb-CSharp.csproj.in index 4d320f9..182ae2e 100644 --- a/src/Microsoft.DotNet.Web.ProjectTemplates/EmptyWeb-CSharp.csproj.in +++ b/src/Microsoft.DotNet.Web.ProjectTemplates/EmptyWeb-CSharp.csproj.in @@ -7,8 +7,4 @@ Company.WebApplication1 - - - - diff --git a/src/Microsoft.DotNet.Web.ProjectTemplates/EmptyWeb-FSharp.fsproj.in b/src/Microsoft.DotNet.Web.ProjectTemplates/EmptyWeb-FSharp.fsproj.in index b0b291a..465baa7 100644 --- a/src/Microsoft.DotNet.Web.ProjectTemplates/EmptyWeb-FSharp.fsproj.in +++ b/src/Microsoft.DotNet.Web.ProjectTemplates/EmptyWeb-FSharp.fsproj.in @@ -12,8 +12,4 @@ - - - - diff --git a/src/Microsoft.DotNet.Web.ProjectTemplates/Microsoft.DotNet.Web.ProjectTemplates.csproj b/src/Microsoft.DotNet.Web.ProjectTemplates/Microsoft.DotNet.Web.ProjectTemplates.csproj index 2eee20d..b13e1d7 100644 --- a/src/Microsoft.DotNet.Web.ProjectTemplates/Microsoft.DotNet.Web.ProjectTemplates.csproj +++ b/src/Microsoft.DotNet.Web.ProjectTemplates/Microsoft.DotNet.Web.ProjectTemplates.csproj @@ -23,17 +23,10 @@ MicrosoftAspNetCoreAppPackageVersion=$(MicrosoftAspNetCoreAppPackageVersion); MicrosoftAspNetCoreAuthenticationAzureADB2CUIPackageVersion=$(MicrosoftAspNetCoreAuthenticationAzureADB2CUIPackageVersion); MicrosoftAspNetCoreAuthenticationAzureADUIPackageVersion=$(MicrosoftAspNetCoreAuthenticationAzureADUIPackageVersion); - MicrosoftAspNetCoreAuthenticationCookiesPackageVersion=$(MicrosoftAspNetCoreAuthenticationCookiesPackageVersion); - MicrosoftAspNetCoreAuthenticationJwtBearerPackageVersion=$(MicrosoftAspNetCoreAuthenticationJwtBearerPackageVersion); - MicrosoftAspNetCoreAuthenticationOpenIdConnectPackageVersion=$(MicrosoftAspNetCoreAuthenticationOpenIdConnectPackageVersion); - MicrosoftAspNetCoreCookiePolicyPackageVersion=$(MicrosoftAspNetCoreCookiePolicyPackageVersion); MicrosoftAspNetCoreDiagnosticsEntityFrameworkCorePackageVersion=$(MicrosoftAspNetCoreDiagnosticsEntityFrameworkCorePackageVersion); - MicrosoftAspNetCoreHttpsPolicyPackageVersion=$(MicrosoftAspNetCoreHttpsPolicyPackageVersion); MicrosoftAspNetCoreIdentityEntityFrameworkCorePackageVersion=$(MicrosoftAspNetCoreIdentityEntityFrameworkCorePackageVersion); - MicrosoftAspNetCoreMvcPackageVersion=$(MicrosoftAspNetCoreMvcPackageVersion); - MicrosoftAspNetCoreMvcRazorViewCompilationPackageVersion=$(MicrosoftAspNetCoreMvcRazorViewCompilationPackageVersion); + MicrosoftAspNetCoreIdentityUIPackageVersion=$(MicrosoftAspNetCoreIdentityUIPackageVersion); MicrosoftAspNetCorePackageVersion=$(MicrosoftAspNetCorePackageVersion); - MicrosoftAspNetCoreStaticFilesPackageVersion=$(MicrosoftAspNetCoreStaticFilesPackageVersion); MicrosoftEntityFrameworkCoreDesignPackageVersion=$(MicrosoftEntityFrameworkCoreDesignPackageVersion); MicrosoftEntityFrameworkCoreSqlitePackageVersion=$(MicrosoftEntityFrameworkCoreSqlitePackageVersion); MicrosoftEntityFrameworkCoreSqlServerPackageVersion=$(MicrosoftEntityFrameworkCoreSqlServerPackageVersion); diff --git a/src/Microsoft.DotNet.Web.ProjectTemplates/RazorClassLibrary-CSharp.csproj.in b/src/Microsoft.DotNet.Web.ProjectTemplates/RazorClassLibrary-CSharp.csproj.in index 3131d24..c7a7314 100644 --- a/src/Microsoft.DotNet.Web.ProjectTemplates/RazorClassLibrary-CSharp.csproj.in +++ b/src/Microsoft.DotNet.Web.ProjectTemplates/RazorClassLibrary-CSharp.csproj.in @@ -1,11 +1,12 @@ - netstandard2.0 + netcoreapp3.0 Company.RazorClassLibrary1 - + + diff --git a/src/Microsoft.DotNet.Web.ProjectTemplates/RazorPagesWeb-CSharp.csproj.in b/src/Microsoft.DotNet.Web.ProjectTemplates/RazorPagesWeb-CSharp.csproj.in index 0c784fc..373bb82 100644 --- a/src/Microsoft.DotNet.Web.ProjectTemplates/RazorPagesWeb-CSharp.csproj.in +++ b/src/Microsoft.DotNet.Web.ProjectTemplates/RazorPagesWeb-CSharp.csproj.in @@ -17,11 +17,15 @@ - - + + + + + + diff --git a/src/Microsoft.DotNet.Web.ProjectTemplates/StarterWeb-CSharp.csproj.in b/src/Microsoft.DotNet.Web.ProjectTemplates/StarterWeb-CSharp.csproj.in index 218be09..9c699ac 100644 --- a/src/Microsoft.DotNet.Web.ProjectTemplates/StarterWeb-CSharp.csproj.in +++ b/src/Microsoft.DotNet.Web.ProjectTemplates/StarterWeb-CSharp.csproj.in @@ -17,11 +17,15 @@ - - + + + + + + diff --git a/src/Microsoft.DotNet.Web.ProjectTemplates/StarterWeb-FSharp.fsproj.in b/src/Microsoft.DotNet.Web.ProjectTemplates/StarterWeb-FSharp.fsproj.in index 01aed32..9a93303 100644 --- a/src/Microsoft.DotNet.Web.ProjectTemplates/StarterWeb-FSharp.fsproj.in +++ b/src/Microsoft.DotNet.Web.ProjectTemplates/StarterWeb-FSharp.fsproj.in @@ -15,8 +15,4 @@ - - - - diff --git a/src/Microsoft.DotNet.Web.ProjectTemplates/WebApi-CSharp.csproj.in b/src/Microsoft.DotNet.Web.ProjectTemplates/WebApi-CSharp.csproj.in index 28bf838..f7bec37 100644 --- a/src/Microsoft.DotNet.Web.ProjectTemplates/WebApi-CSharp.csproj.in +++ b/src/Microsoft.DotNet.Web.ProjectTemplates/WebApi-CSharp.csproj.in @@ -10,8 +10,7 @@ Company.WebApplication1 - - + diff --git a/src/Microsoft.DotNet.Web.ProjectTemplates/WebApi-FSharp.fsproj.in b/src/Microsoft.DotNet.Web.ProjectTemplates/WebApi-FSharp.fsproj.in index d3673b7..7acc46b 100644 --- a/src/Microsoft.DotNet.Web.ProjectTemplates/WebApi-FSharp.fsproj.in +++ b/src/Microsoft.DotNet.Web.ProjectTemplates/WebApi-FSharp.fsproj.in @@ -13,8 +13,4 @@ - - - - diff --git a/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/Angular-CSharp.csproj.in b/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/Angular-CSharp.csproj.in index f93f5d8..3698833 100644 --- a/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/Angular-CSharp.csproj.in +++ b/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/Angular-CSharp.csproj.in @@ -15,7 +15,7 @@ - + diff --git a/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/Microsoft.DotNet.Web.Spa.ProjectTemplates.csproj b/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/Microsoft.DotNet.Web.Spa.ProjectTemplates.csproj index bb7d3c7..bda8a8a 100644 --- a/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/Microsoft.DotNet.Web.Spa.ProjectTemplates.csproj +++ b/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/Microsoft.DotNet.Web.Spa.ProjectTemplates.csproj @@ -20,14 +20,9 @@ - MicrosoftAspNetCoreAppPackageVersion=$(MicrosoftAspNetCoreAppPackageVersion); MicrosoftAspNetCorePackageVersion=$(MicrosoftAspNetCorePackageVersion); MicrosoftAspNetCoreAppPackageVersion=$(MicrosoftAspNetCoreAppPackageVersion); - MicrosoftAspNetCoreHttpsPolicyPackageVersion=$(MicrosoftAspNetCoreHttpsPolicyPackageVersion); - MicrosoftAspNetCoreMvcPackageVersion=$(MicrosoftAspNetCoreMvcPackageVersion); - MicrosoftAspNetCoreSpaServicesPackageVersion=$(MicrosoftAspNetCoreSpaServicesPackageVersion); MicrosoftAspNetCoreSpaServicesExtensionsPackageVersion=$(MicrosoftAspNetCoreSpaServicesExtensionsPackageVersion); - MicrosoftAspNetCoreStaticFilesPackageVersion=$(MicrosoftAspNetCoreStaticFilesPackageVersion); MicrosoftNETCoreApp22PackageVersion=$(MicrosoftNETCoreApp22PackageVersion); diff --git a/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/React-CSharp.csproj.in b/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/React-CSharp.csproj.in index 21b28df..6bc19b7 100644 --- a/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/React-CSharp.csproj.in +++ b/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/React-CSharp.csproj.in @@ -12,7 +12,7 @@ - + diff --git a/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/ReactRedux-CSharp.csproj.in b/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/ReactRedux-CSharp.csproj.in index 2763c4d..71a0a80 100644 --- a/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/ReactRedux-CSharp.csproj.in +++ b/src/Microsoft.DotNet.Web.Spa.ProjectTemplates/ReactRedux-CSharp.csproj.in @@ -12,7 +12,7 @@ - + diff --git a/test/Templates.Test/Helpers/TemplateTestBase.cs b/test/Templates.Test/Helpers/TemplateTestBase.cs index 67c1ef7..19556dd 100644 --- a/test/Templates.Test/Helpers/TemplateTestBase.cs +++ b/test/Templates.Test/Helpers/TemplateTestBase.cs @@ -51,9 +51,17 @@ $@" "; File.WriteAllText(Path.Combine(TemplateOutputDir, "Directory.Build.props"), directoryBuildPropsContent); + + // TODO: remove this once we get a newer version of the SDK which supports an implicit FrameworkReference + // cref https://github.com/aspnet/websdk/issues/424 var directoryBuildTargetsContent = $@" + + + + + "; File.WriteAllText(Path.Combine(TemplateOutputDir, "Directory.Build.targets"), directoryBuildTargetsContent); @@ -135,7 +143,7 @@ $@" .First(attribute => attribute.Key == "DotNetEfFullPath") .Value; - var args = $"\"{dotNetEfFullPath}\" migrations add {migrationName}"; + var args = $"\"{dotNetEfFullPath}\" --verbose migrations add {migrationName}"; // Only run one instance of 'dotnet new' at once, as a workaround for // https://github.com/aspnet/templating/issues/63