From 35fcde140250194959a42df24022b1e340ce0bf2 Mon Sep 17 00:00:00 2001 From: Ken Schlobohm Date: Mon, 4 Oct 2021 13:05:43 -0500 Subject: [PATCH 1/4] Update strategies-migrating-in-production.md --- .../strategies-migrating-in-production.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/architecture/porting-existing-aspnet-apps/strategies-migrating-in-production.md b/docs/architecture/porting-existing-aspnet-apps/strategies-migrating-in-production.md index 97cfaf3f3ac2b..4ca3012b6ccce 100644 --- a/docs/architecture/porting-existing-aspnet-apps/strategies-migrating-in-production.md +++ b/docs/architecture/porting-existing-aspnet-apps/strategies-migrating-in-production.md @@ -43,9 +43,13 @@ Eventually, the entire facade layer corresponds to the new, modern implementatio ## Multi-targeting approaches -Large apps that target .NET Framework may be migrated to ASP.NET Core over time by using multi-targeting and separate code paths for each framework. For example, code that must run in both environments could be modified with [preprocessor `#if`](../../csharp/language-reference/preprocessor-directives.md#conditional-compilation) directives to implement different functionality or use different dependencies when run in .NET Framework versus .NET Core. Another option is to modify project files to include different sets of files based on which framework is being targeted. Project files can use different globbing patterns, such as `*.core.cs`, to include different sets of source files depending on the framework being targeted. Typically you only follow this approach for libraries that will be consumed by multiple web apps. For the web apps themselves, it's generally better to have two separate projects. +Multi-targeting is recommended for large apps that will be migrated over time and for teams using the Strangler pattern approach. This approach can address BindingRedirect and package restoration challenges that surface from mixing [PackageReference](https://docs.microsoft.com/en-us/nuget/consume-packages/package-references-in-project-files) and [packages.config](https://docs.microsoft.com/en-us/nuget/reference/packages-config) restore styles. There are two options available for code that must run in both .NET Framework and .NET Core environments. -These techniques allow a single common codebase to be maintained while new functionality is added and (parts of) the app are ported to use .NET Core. +* [preprocessor `#if`](../../csharp/language-reference/preprocessor-directives.md#conditional-compilation) directives allow you to implement different functionality or use different dependencies when run in .NET Framework versus .NET Core. + +* Project files can use conditional [globbing patterns](https://docs.microsoft.com/en-us/dotnet/core/project-sdk/overview#default-includes-and-excludes), such as `*.core.cs`, to include different sets of files based on which framework is being targeted. + +Typically you only follow these recommendations for class libraries. These techniques allow a single common codebase to be maintained while new functionality is added and features of the app are incrementally ported to use .NET Core. ## Summary From 4d10b28b31b71398b253eb1e9a12b45a09900a3d Mon Sep 17 00:00:00 2001 From: Ken Schlobohm Date: Mon, 4 Oct 2021 13:06:51 -0500 Subject: [PATCH 2/4] Update strategies-migrating-in-production.md --- .../strategies-migrating-in-production.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/architecture/porting-existing-aspnet-apps/strategies-migrating-in-production.md b/docs/architecture/porting-existing-aspnet-apps/strategies-migrating-in-production.md index 4ca3012b6ccce..f2586c5404793 100644 --- a/docs/architecture/porting-existing-aspnet-apps/strategies-migrating-in-production.md +++ b/docs/architecture/porting-existing-aspnet-apps/strategies-migrating-in-production.md @@ -43,7 +43,7 @@ Eventually, the entire facade layer corresponds to the new, modern implementatio ## Multi-targeting approaches -Multi-targeting is recommended for large apps that will be migrated over time and for teams using the Strangler pattern approach. This approach can address BindingRedirect and package restoration challenges that surface from mixing [PackageReference](https://docs.microsoft.com/en-us/nuget/consume-packages/package-references-in-project-files) and [packages.config](https://docs.microsoft.com/en-us/nuget/reference/packages-config) restore styles. There are two options available for code that must run in both .NET Framework and .NET Core environments. +Multi-targeting is recommended for large apps that will be migrated over time and for teams applying the Strangler pattern approach. This approach can address BindingRedirect and package restoration challenges that surface from mixing [PackageReference](https://docs.microsoft.com/en-us/nuget/consume-packages/package-references-in-project-files) and [packages.config](https://docs.microsoft.com/en-us/nuget/reference/packages-config) restore styles. There are two options available for code that must run in both .NET Framework and .NET Core environments. * [preprocessor `#if`](../../csharp/language-reference/preprocessor-directives.md#conditional-compilation) directives allow you to implement different functionality or use different dependencies when run in .NET Framework versus .NET Core. From b4ba82166292da6b78711d2674b8318cd50b2dba Mon Sep 17 00:00:00 2001 From: David Pine Date: Fri, 8 Oct 2021 07:57:03 -0500 Subject: [PATCH 3/4] Apply suggestions from code review --- .../strategies-migrating-in-production.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/architecture/porting-existing-aspnet-apps/strategies-migrating-in-production.md b/docs/architecture/porting-existing-aspnet-apps/strategies-migrating-in-production.md index f2586c5404793..7c1f436a321dc 100644 --- a/docs/architecture/porting-existing-aspnet-apps/strategies-migrating-in-production.md +++ b/docs/architecture/porting-existing-aspnet-apps/strategies-migrating-in-production.md @@ -43,11 +43,11 @@ Eventually, the entire facade layer corresponds to the new, modern implementatio ## Multi-targeting approaches -Multi-targeting is recommended for large apps that will be migrated over time and for teams applying the Strangler pattern approach. This approach can address BindingRedirect and package restoration challenges that surface from mixing [PackageReference](https://docs.microsoft.com/en-us/nuget/consume-packages/package-references-in-project-files) and [packages.config](https://docs.microsoft.com/en-us/nuget/reference/packages-config) restore styles. There are two options available for code that must run in both .NET Framework and .NET Core environments. +Multi-targeting is recommended for large apps that will be migrated over time and for teams applying the Strangler pattern approach. This approach can address `BindingRedirect` and package restoration challenges that surface from mixing [PackageReference](/nuget/consume-packages/package-references-in-project-files) and [packages.config](/nuget/reference/packages-config) restore styles. There are two options available for code that must run in both .NET Framework and .NET Core environments. -* [preprocessor `#if`](../../csharp/language-reference/preprocessor-directives.md#conditional-compilation) directives allow you to implement different functionality or use different dependencies when run in .NET Framework versus .NET Core. +* Preprocessor [`#if` in C#](../../csharp/language-reference/preprocessor-directives.md#conditional-compilation) (or [`#If` in Visual Basic]([preprocessor `#if`](../../visual-basic/reference/language-specification/preprocessing-directives.md#conditional-compilation))) directives allow you to implement different functionality or use different dependencies when run in .NET Framework versus .NET Core. -* Project files can use conditional [globbing patterns](https://docs.microsoft.com/en-us/dotnet/core/project-sdk/overview#default-includes-and-excludes), such as `*.core.cs`, to include different sets of files based on which framework is being targeted. +* Project files can use conditional [globbing patterns](/dotnet/core/project-sdk/overview.md#default-includes-and-excludes), such as `*.core.cs`, to include different sets of files based on which framework is being targeted. Typically you only follow these recommendations for class libraries. These techniques allow a single common codebase to be maintained while new functionality is added and features of the app are incrementally ported to use .NET Core. From 8adc8ff717ad2498d9b54c6e4124000e252bb914 Mon Sep 17 00:00:00 2001 From: David Pine Date: Fri, 8 Oct 2021 08:02:33 -0500 Subject: [PATCH 4/4] Apply suggestions from code review --- .../strategies-migrating-in-production.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/architecture/porting-existing-aspnet-apps/strategies-migrating-in-production.md b/docs/architecture/porting-existing-aspnet-apps/strategies-migrating-in-production.md index 7c1f436a321dc..73cfe54bd76c9 100644 --- a/docs/architecture/porting-existing-aspnet-apps/strategies-migrating-in-production.md +++ b/docs/architecture/porting-existing-aspnet-apps/strategies-migrating-in-production.md @@ -45,7 +45,7 @@ Eventually, the entire facade layer corresponds to the new, modern implementatio Multi-targeting is recommended for large apps that will be migrated over time and for teams applying the Strangler pattern approach. This approach can address `BindingRedirect` and package restoration challenges that surface from mixing [PackageReference](/nuget/consume-packages/package-references-in-project-files) and [packages.config](/nuget/reference/packages-config) restore styles. There are two options available for code that must run in both .NET Framework and .NET Core environments. -* Preprocessor [`#if` in C#](../../csharp/language-reference/preprocessor-directives.md#conditional-compilation) (or [`#If` in Visual Basic]([preprocessor `#if`](../../visual-basic/reference/language-specification/preprocessing-directives.md#conditional-compilation))) directives allow you to implement different functionality or use different dependencies when run in .NET Framework versus .NET Core. +* Preprocessor [`#if` in C#](../../csharp/language-reference/preprocessor-directives.md#conditional-compilation) (or [`#If` in Visual Basic]([preprocessor `#if`](https://docs.microsoft.com/dotnet/visual-basic/reference/language-specification/preprocessing-directives#conditional-compilation))) directives allow you to implement different functionality or use different dependencies when run in .NET Framework versus .NET Core. * Project files can use conditional [globbing patterns](/dotnet/core/project-sdk/overview.md#default-includes-and-excludes), such as `*.core.cs`, to include different sets of files based on which framework is being targeted.