Remove netframework assets older than net461 from builds and packaging (#53319)
authorViktor Hofer <viktor.hofer@microsoft.com>
Thu, 27 May 2021 06:17:21 +0000 (08:17 +0200)
committerGitHub <noreply@github.com>
Thu, 27 May 2021 06:17:21 +0000 (08:17 +0200)
Only a very few number of projects still built for net45-net46.
This PR trims out these assets from the build which of course
results in them not being packaged (as there is no harvesting
mechanism in the repository present anymore).

Suppressing the package warnings for the intentionally dropped
assets and cleaning up conditions in the project file as well.

For more details please see the reasoning in the linked issue.

Contributes to #53282

26 files changed:
src/libraries/Common/src/System/Net/Http/aspnetcore/NetEventSource.Common.cs
src/libraries/Common/src/System/Net/Logging/NetEventSource.Common.cs
src/libraries/Common/src/System/SR.cs
src/libraries/Directory.Build.props
src/libraries/System.ComponentModel.Composition.Registration/pkg/System.ComponentModel.Composition.Registration.pkgproj
src/libraries/System.ComponentModel.Composition/pkg/System.ComponentModel.Composition.pkgproj
src/libraries/System.Diagnostics.DiagnosticSource/pkg/System.Diagnostics.DiagnosticSource.pkgproj
src/libraries/System.Diagnostics.DiagnosticSource/ref/System.Diagnostics.DiagnosticSource.csproj
src/libraries/System.Diagnostics.DiagnosticSource/src/System.Diagnostics.DiagnosticSource.csproj
src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Activity.Current.net45.cs [deleted file]
src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/DiagnosticSourceEventSource.cs
src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Metrics/Instrument.cs
src/libraries/System.DirectoryServices.AccountManagement/pkg/System.DirectoryServices.AccountManagement.pkgproj
src/libraries/System.DirectoryServices.Protocols/pkg/System.DirectoryServices.Protocols.pkgproj
src/libraries/System.DirectoryServices/pkg/System.DirectoryServices.pkgproj
src/libraries/System.IO.Packaging/pkg/System.IO.Packaging.pkgproj
src/libraries/System.IO.Packaging/ref/System.IO.Packaging.csproj
src/libraries/System.IO.Packaging/ref/System.IO.Packaging.net461.cs [moved from src/libraries/System.IO.Packaging/ref/System.IO.Packaging.net46.cs with 100% similarity]
src/libraries/System.IO.Packaging/src/System.IO.Packaging.csproj
src/libraries/System.Management/pkg/System.Management.pkgproj
src/libraries/System.Reflection.Context/pkg/System.Reflection.Context.pkgproj
src/libraries/System.Runtime.Caching/pkg/System.Runtime.Caching.pkgproj
src/libraries/System.Runtime.CompilerServices.Unsafe/pkg/System.Runtime.CompilerServices.Unsafe.pkgproj
src/libraries/System.Runtime.CompilerServices.Unsafe/ref/System.Runtime.CompilerServices.Unsafe.csproj
src/libraries/System.Runtime.CompilerServices.Unsafe/src/System.Runtime.CompilerServices.Unsafe.ilproj
src/libraries/System.Speech/pkg/System.Speech.pkgproj

index 6905c66..8a94400 100644 (file)
@@ -14,9 +14,6 @@ using System.Diagnostics.Tracing;
 using System.Globalization;
 using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
-#if NET46
-using System.Security;
-#endif
 
 #pragma warning disable CA1823 // not all IDs are used by all partial providers
 
@@ -40,9 +37,6 @@ namespace System.Net
     //   method that takes an object and optionally provides a string representation of it, in case a particular library wants to customize further.
 
     /// <summary>Provides logging facilities for System.Net libraries.</summary>
-#if NET46
-    [SecuritySafeCritical]
-#endif
     internal sealed partial class NetEventSource : EventSource
     {
         /// <summary>The single event source instance to use for all logging.</summary>
index 96090ce..2a275a5 100644 (file)
@@ -13,9 +13,6 @@ using System.Diagnostics.Tracing;
 using System.Diagnostics.CodeAnalysis;
 using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
-#if NET46
-using System.Security;
-#endif
 
 #pragma warning disable CA1823 // not all IDs are used by all partial providers
 
@@ -39,9 +36,6 @@ namespace System.Net
     //   method that takes an object and optionally provides a string representation of it, in case a particular library wants to customize further.
 
     /// <summary>Provides logging facilities for System.Net libraries.</summary>
-#if NET46
-    [SecuritySafeCritical]
-#endif
     internal sealed partial class NetEventSource : EventSource
     {
 #if !ES_BUILD_STANDALONE
index 2589492..5d8d88b 100644 (file)
@@ -8,20 +8,13 @@ namespace System
 {
     internal static partial class SR
     {
-#if !NET45 // AppContext is not supported on < .NET Framework 4.5
         private static readonly bool s_usingResourceKeys = AppContext.TryGetSwitch("System.Resources.UseSystemResourceKeys", out bool usingResourceKeys) ? usingResourceKeys : false;
-#endif
 
         // This method is used to decide if we need to append the exception message parameters to the message when calling SR.Format.
         // by default it returns the value of System.Resources.UseSystemResourceKeys AppContext switch or false if not specified.
         // Native code generators can replace the value this returns based on user input at the time of native code generation.
         // The Linker is also capable of replacing the value of this method when the application is being trimmed.
-        private static bool UsingResourceKeys() =>
-#if !NET45 // AppContext is not supported on < .NET Framework 4.5
-            s_usingResourceKeys;
-#else
-            false;
-#endif
+        private static bool UsingResourceKeys() => s_usingResourceKeys;
 
         internal static string GetResourceString(string resourceKey)
         {
index e9cd76e..cc5a02e 100644 (file)
@@ -27,7 +27,7 @@
 
   <PropertyGroup>
     <!-- Build all .NET Framework configurations when net48 is passed in. This is for convenience. -->
-    <AdditionalBuildTargetFrameworks Condition="'$(BuildTargetFramework)' == 'net48'">net45;net451;net452;net46;net461;net462;net47;net471;net472</AdditionalBuildTargetFrameworks>
+    <AdditionalBuildTargetFrameworks Condition="'$(BuildTargetFramework)' == 'net48'">net461;net462;net47;net471;net472</AdditionalBuildTargetFrameworks>
     <AdditionalBuildTargetFrameworks Condition="'$(DotNetBuildFromSource)' == 'true' and '$(BuildAllProjects)' == 'true'">$(AdditionalBuildTargetFrameworks);netstandard2.0</AdditionalBuildTargetFrameworks>
   </PropertyGroup>
 
index 0a6dbf5..2ef483e 100644 (file)
@@ -4,9 +4,9 @@
     <ProjectReference Include="..\ref\System.ComponentModel.Composition.Registration.csproj">
       <SupportedFramework>netcoreapp3.0;$(AllXamarinFrameworks)</SupportedFramework>
     </ProjectReference>
-    <SupportedFramework Include="net45" Version="4.0.0.0" />
+    <SupportedFramework Include="net461" Version="4.0.0.0" />
     <ProjectReference Include="..\src\System.ComponentModel.Composition.Registration.csproj" />
-    <InboxOnTargetFramework Include="net45">
+    <InboxOnTargetFramework Include="net461">
       <AsFrameworkReference>true</AsFrameworkReference>
     </InboxOnTargetFramework>
   </ItemGroup>
index e1461f2..ae52845 100644 (file)
@@ -2,10 +2,10 @@
   <Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))" />
   <ItemGroup>
     <ProjectReference Include="..\ref\System.ComponentModel.Composition.csproj">
-      <SupportedFramework>uap10.0.16299;netcoreapp2.0;net45;$(AllXamarinFrameworks)</SupportedFramework>
+      <SupportedFramework>uap10.0.16299;netcoreapp2.0;net461;$(AllXamarinFrameworks)</SupportedFramework>
     </ProjectReference>
     <ProjectReference Include="..\src\System.ComponentModel.Composition.csproj" />
-    <InboxOnTargetFramework Include="net45">
+    <InboxOnTargetFramework Include="net461">
       <AsFrameworkReference>true</AsFrameworkReference>
     </InboxOnTargetFramework>
     <InboxOnTargetFramework Include="uap10.0.16299" />
index b85c378..87afcb6 100644 (file)
@@ -2,7 +2,7 @@
   <Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))" />
   <ItemGroup>
     <ProjectReference Include="..\src\System.Diagnostics.DiagnosticSource.csproj">
-      <SupportedFramework>net45;netcoreapp2.0;uap10.0.16299;$(AllXamarinFrameworks)</SupportedFramework>
+      <SupportedFramework>net461;netcoreapp2.0;uap10.0.16299;$(AllXamarinFrameworks)</SupportedFramework>
     </ProjectReference>
     
     <!-- Since UAP and .NETCoreApp are package based we still want to enable
@@ -15,7 +15,7 @@
     </ValidatePackageSuppression>
 
     <!-- Exclude TFMs that aren't supported by the package anymore from validation. -->
-    <ExcludeHarvestedSupportedFramework Include="netcoreapp1.0;netcoreapp1.1;netcore45;netcore451;netcore50;uap10.0;wp8;wpa81" />
+    <ExcludeHarvestedSupportedFramework Include="netcoreapp1.0;netcoreapp1.1;netcore45;netcore451;netcore50;uap10.0;wp8;wpa81;net45;net451;net46" />
   </ItemGroup>
   <Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.targets))" />
 </Project>
index db3fc7b..a323120 100644 (file)
@@ -1,12 +1,12 @@
 <Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
-    <TargetFrameworks>netstandard2.0;net45</TargetFrameworks>
+    <TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
     <CLSCompliant>false</CLSCompliant>
     <Nullable>enable</Nullable>
   </PropertyGroup>
   <!-- DesignTimeBuild requires all the TargetFramework Derived Properties to not be present in the first property group. -->
   <PropertyGroup>
-    <DefineConstants Condition="'$(TargetFramework)' == 'net45'">$(DefineConstants);ALLOW_PARTIALLY_TRUSTED_CALLERS</DefineConstants>
+    <DefineConstants Condition="'$(TargetFramework)' == 'net461'">$(DefineConstants);ALLOW_PARTIALLY_TRUSTED_CALLERS</DefineConstants>
   </PropertyGroup>
   <ItemGroup>
     <Compile Include="System.Diagnostics.DiagnosticSource.cs" />
@@ -16,7 +16,7 @@
   <ItemGroup>
     <PackageReference Include="System.Memory" Version="$(SystemMemoryVersion)" />
   </ItemGroup>
-  <ItemGroup Condition="'$(TargetFramework)' == 'net45'">
+  <ItemGroup Condition="'$(TargetFramework)' == 'net461'">
     <Reference Include="System.Runtime" />
   </ItemGroup>
 </Project>
\ No newline at end of file
index 0a453be..6341ed7 100644 (file)
@@ -4,12 +4,11 @@
     <CLSCompliant>false</CLSCompliant>
     <NoWarn>$(NoWarn);SA1205</NoWarn>
     <Nullable>enable</Nullable>
-    <TargetFrameworks>$(NetCoreAppCurrent);net5.0;netstandard2.0;net46;net45</TargetFrameworks>
+    <TargetFrameworks>$(NetCoreAppCurrent);net5.0;netstandard2.0;net461</TargetFrameworks>
     <ExcludeCurrentNetCoreAppFromPackage>true</ExcludeCurrentNetCoreAppFromPackage>
   </PropertyGroup>
   <!-- DesignTimeBuild requires all the TargetFramework Derived Properties to not be present in the first property group. -->
   <PropertyGroup>
-    <DefineConstants Condition="'$(TargetFramework)' == 'net45'">$(DefineConstants);NO_EVENTSOURCE_COMPLEX_TYPE_SUPPORT;NO_ARRAY_EMPTY_SUPPORT</DefineConstants>
     <DefineConstants Condition="$([MSBuild]::GetTargetFrameworkIdentifier('$(TargetFramework)')) == '.NETFramework'">$(DefineConstants);ALLOW_PARTIALLY_TRUSTED_CALLERS;ENABLE_HTTP_HANDLER</DefineConstants>
     <DefineConstants Condition="$([MSBuild]::GetTargetFrameworkIdentifier('$(TargetFramework)')) == '.NETCoreApp'">$(DefineConstants);W3C_DEFAULT_ID_FORMAT</DefineConstants>
   </PropertyGroup>
@@ -45,8 +44,8 @@
     <Compile Include="System\Diagnostics\Metrics\Histogram.cs" />
     <Compile Include="System\Diagnostics\Metrics\Instrument.cs" />
     <Compile Include="System\Diagnostics\Metrics\Instrument.common.cs" />
-    <Compile Include="System\Diagnostics\Metrics\Instrument.netcore.cs" Condition="'$(TargetFramework)' == '$(NetCoreAppCurrent)' Or '$(TargetFramework)' == 'net5.0'" />
-    <Compile Include="System\Diagnostics\Metrics\Instrument.netfx.cs" Condition="'$(TargetFramework)' != '$(NetCoreAppCurrent)' And '$(TargetFramework)' != 'net5.0'" />
+    <Compile Include="System\Diagnostics\Metrics\Instrument.netcore.cs" Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'" />
+    <Compile Include="System\Diagnostics\Metrics\Instrument.netfx.cs" Condition="'$(TargetFrameworkIdentifier)' != '.NETCoreApp'" />
     <Compile Include="System\Diagnostics\Metrics\Measurement.cs" />
     <Compile Include="System\Diagnostics\Metrics\Meter.cs" />
     <Compile Include="System\Diagnostics\Metrics\MeterListener.cs" />
       <Link>Common\System\LocalAppContextSwitches.Common.cs</Link>
     </Compile>
   </ItemGroup>
-  <ItemGroup Condition="'$(TargetFramework)' != 'net45'">
+  <ItemGroup>
     <Compile Include="System\Diagnostics\Activity.Current.net46.cs" />
   </ItemGroup>
-  <ItemGroup Condition="'$(TargetFramework)' == 'net45'">
-    <Compile Include="System\Diagnostics\Activity.Current.net45.cs" />
-  </ItemGroup>
   <ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' or
                         '$(TargetFramework)' == 'netstandard2.0'">
     <Compile Include="System\Diagnostics\Activity.DateTime.corefx.cs" />
diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Activity.Current.net45.cs b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Activity.Current.net45.cs
deleted file mode 100644 (file)
index 3ee6a7c..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-using System.Runtime.Remoting;
-using System.Runtime.Remoting.Messaging;
-using System.Security;
-
-namespace System.Diagnostics
-{
-    public partial class Activity
-    {
-        /// <summary>
-        /// Gets or sets the current operation (Activity) for the current thread.  This flows
-        /// across async calls.
-        /// </summary>
-        public static Activity Current
-        {
-#if ALLOW_PARTIALLY_TRUSTED_CALLERS
-            [System.Security.SecuritySafeCriticalAttribute]
-#endif
-            get
-            {
-                ObjectHandle activityHandle = (ObjectHandle)CallContext.LogicalGetData(FieldKey);
-
-                // Unwrap the Activity if it was set in the same AppDomain (as FieldKey is AppDomain-specific).
-                if (activityHandle != null)
-                {
-                    return (Activity)activityHandle.Unwrap();
-                }
-                return null;
-            }
-
-#if ALLOW_PARTIALLY_TRUSTED_CALLERS
-            [System.Security.SecuritySafeCriticalAttribute]
-#endif
-            set
-            {
-                if (ValidateSetCurrent(value))
-                {
-                    SetCurrent(value);
-                }
-            }
-        }
-
-#region private
-
-#if ALLOW_PARTIALLY_TRUSTED_CALLERS
-        [System.Security.SecuritySafeCriticalAttribute]
-#endif
-        private static void SetCurrent(Activity activity)
-        {
-            // Applications may implicitly or explicitly call other AppDomains
-            // that do not have DiagnosticSource DLL, therefore may not be able to resolve Activity type stored in the logical call context.
-            // To avoid it, we wrap Activity with ObjectHandle.
-            CallContext.LogicalSetData(FieldKey, new ObjectHandle(activity));
-        }
-
-        // Slot name depends on the AppDomain Id in order to prevent AppDomains to use the same Activity
-        // Cross AppDomain calls are considered as 'external' i.e. only Activity Id and Baggage should be propagated and
-        // new Activity should be started for the RPC calls (incoming and outgoing)
-        private static readonly string FieldKey = $"{typeof(Activity).FullName}_{AppDomain.CurrentDomain.Id}";
-#endregion //private
-    }
-}
index 2c3ee45..e4b5b8c 100644 (file)
@@ -219,7 +219,6 @@ namespace System.Diagnostics
             WriteEvent(1, Message);
         }
 
-#if !NO_EVENTSOURCE_COMPLEX_TYPE_SUPPORT
         /// <summary>
         /// Events from DiagnosticSource can be forwarded to EventSource using this event.
         /// </summary>
@@ -232,7 +231,7 @@ namespace System.Diagnostics
         {
             WriteEvent(2, SourceName, EventName, Arguments);
         }
-#endif
+
         /// <summary>
         /// This is only used on V4.5 systems that don't have the ability to log KeyValuePairs directly.
         /// It will eventually go away, but we should always reserve the ID for this.
@@ -243,7 +242,6 @@ namespace System.Diagnostics
             WriteEvent(3, SourceName, EventName, ArgmentsJson);
         }
 
-#if !NO_EVENTSOURCE_COMPLEX_TYPE_SUPPORT
         /// <summary>
         /// Used to mark the beginning of an activity
         /// </summary>
@@ -321,7 +319,6 @@ namespace System.Diagnostics
         {
             WriteEvent(9, SourceName, EventName, Arguments);
         }
-#endif
 
         /// <summary>
         /// Fires when a new DiagnosticSource becomes available.
@@ -343,11 +340,7 @@ namespace System.Diagnostics
         [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode",
             Justification = "Arguments parameter is trimmer safe")]
 #endif
-#if NO_EVENTSOURCE_COMPLEX_TYPE_SUPPORT
-        [Event(11, Keywords = Keywords.Events)]
-#else
         [Event(11, Keywords = Keywords.Events, ActivityOptions = EventActivityOptions.Recursive)]
-#endif
         private void ActivityStart(string SourceName, string ActivityName, IEnumerable<KeyValuePair<string, string?>> Arguments) =>
             WriteEvent(11, SourceName, ActivityName, Arguments);
 
@@ -361,65 +354,16 @@ namespace System.Diagnostics
         [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode",
             Justification = "Arguments parameter is trimmer safe")]
 #endif
-#if NO_EVENTSOURCE_COMPLEX_TYPE_SUPPORT
-        [Event(12, Keywords = Keywords.Events)]
-#else
         [Event(12, Keywords = Keywords.Events, ActivityOptions = EventActivityOptions.Recursive)]
-#endif
         private void ActivityStop(string SourceName, string ActivityName, IEnumerable<KeyValuePair<string, string?>> Arguments) =>
             WriteEvent(12, SourceName, ActivityName, Arguments);
 
         #region private
 
-#if NO_EVENTSOURCE_COMPLEX_TYPE_SUPPORT
-        /// <summary>
-        /// Converts a keyvalue bag to JSON. Only used on V4.5 EventSources.
-        /// </summary>
-        private static string ToJson(IEnumerable<KeyValuePair<string, string>> keyValues)
-        {
-            StringBuilder sb = new StringBuilder();
-            sb.AppendLine("{");
-            bool first = true;
-            foreach (var keyValue in keyValues)
-            {
-                if (!first)
-                    sb.Append(',').AppendLine();
-                first = false;
-
-                sb.Append('"').Append(keyValue.Key).Append("\":\"");
-
-                // Write out the value characters, escaping things as needed.
-                foreach (var c in keyValue.Value)
-                {
-                    if (char.IsControl(c))
-                    {
-                        if (c == '\n')
-                            sb.Append("\\n");
-                        else if (c == '\r')
-                            sb.Append("\\r");
-                        else
-                            sb.Append("\\u").Append(((int)c).ToString("x").PadLeft(4, '0'));
-                    }
-                    else
-                    {
-                        if (c == '"' || c == '\\')
-                            sb.Append('\\');
-                        sb.Append(c);
-                    }
-                }
-                sb.Append('"');     // Close the string.
-            }
-            sb.AppendLine().AppendLine("}");
-            return sb.ToString();
-        }
-#endif
-
         private DiagnosticSourceEventSource()
-#if !NO_EVENTSOURCE_COMPLEX_TYPE_SUPPORT
             // This constructor uses EventSourceSettings which is only available on V4.6 and above
             // Use the EventSourceSettings to turn on support for complex types, if available (v4.6 and above).
             : base(EventSourceSettings.EtwSelfDescribingEventFormat)
-#endif
         {
         }
 
@@ -672,7 +616,6 @@ namespace System.Diagnostics
                 Action<string, string, IEnumerable<KeyValuePair<string, string?>>>? writeEvent = null;
                 if (activityName != null && activityName.Contains("Activity"))
                 {
-#if !NO_EVENTSOURCE_COMPLEX_TYPE_SUPPORT
                     writeEvent = activityName switch
                     {
                         nameof(Activity1Start) => _eventSource.Activity1Start,
@@ -683,7 +626,6 @@ namespace System.Diagnostics
                         nameof(RecursiveActivity1Stop) => _eventSource.RecursiveActivity1Stop,
                         _ => null
                     };
-#endif
 
                     if (writeEvent == null)
                         _eventSource.Message("DiagnosticSource: Could not find Event to log Activity " + activityName);
@@ -691,14 +633,7 @@ namespace System.Diagnostics
 
                 if (writeEvent == null)
                 {
-#if !NO_EVENTSOURCE_COMPLEX_TYPE_SUPPORT
                     writeEvent = _eventSource.Event;
-#else
-                    writeEvent = delegate (string sourceName, string eventName, IEnumerable<KeyValuePair<string, string>> arguments)
-                    {
-                        _eventSource.EventJson(sourceName, eventName, ToJson(arguments));
-                    };
-#endif
                 }
 
                 // Set up a subscription that watches for the given Diagnostic Sources and events which will call back
index 8851f30..34a5b04 100644 (file)
@@ -13,11 +13,7 @@ namespace System.Diagnostics.Metrics
 #endif
     public abstract class Instrument
     {
-#if NO_ARRAY_EMPTY_SUPPORT
-        internal static KeyValuePair<string, object?>[] EmptyTags { get; } = new KeyValuePair<string, object?>[0];
-#else
         internal static KeyValuePair<string, object?>[] EmptyTags { get; } = Array.Empty<KeyValuePair<string, object?>>();
-#endif // NO_ARRAY_EMPTY_SUPPORT
 
         // The SyncObject is used to synchronize the following operations:
         //  - Instrument.Publish()
index 531c900..7cb832a 100644 (file)
@@ -2,14 +2,14 @@
   <Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))" />
   <ItemGroup>
     <ProjectReference Include="..\ref\System.DirectoryServices.AccountManagement.csproj">
-      <SupportedFramework>uap10.0.16299;netcoreapp2.0;net45;$(AllXamarinFrameworks)</SupportedFramework>
+      <SupportedFramework>uap10.0.16299;netcoreapp2.0;net461;$(AllXamarinFrameworks)</SupportedFramework>
     </ProjectReference>
     <ProjectReference Include="..\src\System.DirectoryServices.AccountManagement.csproj" />
-    <InboxOnTargetFramework Include="net45">
+    <InboxOnTargetFramework Include="net461">
       <AsFrameworkReference>true</AsFrameworkReference>
     </InboxOnTargetFramework>
     <File Include="$(PlaceHolderFile)">
-      <TargetPath>runtimes/win/lib/net45</TargetPath>
+      <TargetPath>runtimes/win/lib/net461</TargetPath>
     </File>
   </ItemGroup>
   <Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.targets))" />
index 6a28430..53da13e 100644 (file)
@@ -2,15 +2,15 @@
   <Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))" />
   <ItemGroup>
     <ProjectReference Include="..\ref\System.DirectoryServices.Protocols.csproj">
-      <SupportedFramework>uap10.0.16299;netcoreapp2.0;net45;$(AllXamarinFrameworks)</SupportedFramework>
+      <SupportedFramework>uap10.0.16299;netcoreapp2.0;net461;$(AllXamarinFrameworks)</SupportedFramework>
     </ProjectReference>
     <ProjectReference Include="..\src\System.DirectoryServices.Protocols.csproj" />
 
-    <InboxOnTargetFramework Include="net45">
+    <InboxOnTargetFramework Include="net461">
       <AsFrameworkReference>true</AsFrameworkReference>
     </InboxOnTargetFramework>
     <File Include="$(PlaceHolderFile)">
-      <TargetPath>runtimes/win/lib/net45</TargetPath>
+      <TargetPath>runtimes/win/lib/net461</TargetPath>
     </File>
   </ItemGroup>
   <Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.targets))" />
index 47efdc8..280e5cc 100644 (file)
@@ -2,15 +2,15 @@
   <Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))" />
   <ItemGroup>
     <ProjectReference Include="..\ref\System.DirectoryServices.csproj">
-      <SupportedFramework>uap10.0.16299;netcoreapp2.0;net45;$(AllXamarinFrameworks)</SupportedFramework>
+      <SupportedFramework>uap10.0.16299;netcoreapp2.0;net461;$(AllXamarinFrameworks)</SupportedFramework>
     </ProjectReference>
     <ProjectReference Include="..\src\System.DirectoryServices.csproj" />
     
-    <InboxOnTargetFramework Include="net45">
+    <InboxOnTargetFramework Include="net461">
       <AsFrameworkReference>true</AsFrameworkReference>
     </InboxOnTargetFramework>
     <File Include="$(PlaceHolderFile)">
-      <TargetPath>runtimes/win/lib/net45</TargetPath>
+      <TargetPath>runtimes/win/lib/net461</TargetPath>
     </File>
   </ItemGroup>
   <Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.targets))" />
index 79cc61d..6335a71 100644 (file)
@@ -2,12 +2,12 @@
   <Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))" />
   <ItemGroup>
     <ProjectReference Include="..\ref\System.IO.Packaging.csproj">
-      <SupportedFramework>net46;netcoreapp2.0;uap10.0.16299;$(AllXamarinFrameworks)</SupportedFramework>
+      <SupportedFramework>net461;netcoreapp2.0;uap10.0.16299;$(AllXamarinFrameworks)</SupportedFramework>
     </ProjectReference>
     <ProjectReference Include="..\src\System.IO.Packaging.csproj" />
 
     <!-- Exclude TFMs that aren't supported by the package anymore from validation. -->
-    <ExcludeHarvestedSupportedFramework Include="netcoreapp1.0;netcoreapp1.1;netcore50;uap10.0" />
+    <ExcludeHarvestedSupportedFramework Include="netcoreapp1.0;netcoreapp1.1;netcore50;uap10.0;net46" />
   </ItemGroup>
   <Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.targets))" />
 </Project>
\ No newline at end of file
index fa560a5..3d0cb8b 100644 (file)
@@ -1,6 +1,6 @@
 <Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
-    <TargetFrameworks>netstandard2.0;net46</TargetFrameworks>
+    <TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
     <Nullable>enable</Nullable>
   </PropertyGroup>
   <ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
@@ -8,8 +8,8 @@
     <Compile Include="System.IO.Packaging.Serialization.cs" />
     <Compile Include="System.IO.Packaging.PackUriScheme.cs" />
   </ItemGroup>
-  <ItemGroup Condition="'$(TargetFramework)' == 'net46'">
-    <Compile Include="System.IO.Packaging.net46.cs" />
+  <ItemGroup Condition="'$(TargetFramework)' == 'net461'">
+    <Compile Include="System.IO.Packaging.net461.cs" />
     <Reference Include="WindowsBase" />
   </ItemGroup>
 </Project>
\ No newline at end of file
index f563b9e..1f52d16 100644 (file)
@@ -1,12 +1,12 @@
 <Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
-    <TargetFrameworks>netstandard2.0;net46</TargetFrameworks>
+    <TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
     <Nullable>enable</Nullable>
   </PropertyGroup>
   <!-- DesignTimeBuild requires all the TargetFramework Derived Properties to not be present in the first property group. -->
   <PropertyGroup>
-    <IsPartialFacadeAssembly Condition="'$(TargetFramework)' == 'net46'">true</IsPartialFacadeAssembly>
+    <IsPartialFacadeAssembly Condition="'$(TargetFramework)' == 'net461'">true</IsPartialFacadeAssembly>
   </PropertyGroup>
   <ItemGroup Condition="'$(IsPartialFacadeAssembly)' != 'true'">
     <Compile Include="System\IO\Packaging\CompressionOption.cs" />
@@ -38,7 +38,7 @@
     <Compile Include="System\IO\Packaging\ZipWrappingStream.cs" />
     <Compile Include="System\IO\Packaging\PackUriHelper.PackUriScheme.cs" />
   </ItemGroup>
-  <ItemGroup Condition="'$(TargetFramework)' == 'net46'">
+  <ItemGroup Condition="'$(TargetFramework)' == 'net461'">
     <Reference Include="WindowsBase" />
   </ItemGroup>
 </Project>
\ No newline at end of file
index f1ede93..b30d827 100644 (file)
@@ -2,14 +2,14 @@
   <Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))" />
   <ItemGroup>
     <ProjectReference Include="..\ref\System.Management.csproj">
-      <SupportedFramework>uap10.0.16299;netcoreapp2.0;net45;$(AllXamarinFrameworks)</SupportedFramework>
+      <SupportedFramework>uap10.0.16299;netcoreapp2.0;net461;$(AllXamarinFrameworks)</SupportedFramework>
     </ProjectReference>
     <ProjectReference Include="..\src\System.Management.csproj" />
-    <InboxOnTargetFramework Include="net45">
+    <InboxOnTargetFramework Include="net461">
       <AsFrameworkReference>true</AsFrameworkReference>
     </InboxOnTargetFramework>
     <File Include="$(PlaceHolderFile)">
-      <TargetPath>runtimes/win/lib/net45</TargetPath>
+      <TargetPath>runtimes/win/lib/net461</TargetPath>
     </File>
   </ItemGroup>
   <Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.targets))" />
index 6f15c9c..29115a9 100644 (file)
@@ -2,10 +2,10 @@
   <Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))" />
   <ItemGroup>
     <ProjectReference Include="..\ref\System.Reflection.Context.csproj">
-      <SupportedFramework>uap10.0.16299;netcoreapp2.0;net45;$(AllXamarinFrameworks)</SupportedFramework>
+      <SupportedFramework>uap10.0.16299;netcoreapp2.0;net461;$(AllXamarinFrameworks)</SupportedFramework>
     </ProjectReference>
     <ProjectReference Include="..\src\System.Reflection.Context.csproj" />
-    <InboxOnTargetFramework Include="net45">
+    <InboxOnTargetFramework Include="net461">
       <AsFrameworkReference>true</AsFrameworkReference>
     </InboxOnTargetFramework>
     <!-- Since UAP are package based we still want to enable
@@ -18,7 +18,7 @@
     </ValidatePackageSuppression>
 
     <!-- Exclude TFMs that aren't supported by the package anymore from validation. -->
-    <ExcludeHarvestedSupportedFramework Include="netcoreapp1.0;netcoreapp1.1;netcore45;netcore451;netcore50;uap10.0;wpa81" />
+    <ExcludeHarvestedSupportedFramework Include="netcoreapp1.0;netcoreapp1.1;netcore45;netcore451;netcore50;uap10.0;wpa81;net45;net451;net46" />
   </ItemGroup>
   
   <Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.targets))" />
index d29b573..2698bb7 100644 (file)
@@ -2,15 +2,15 @@
   <Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))" />
   <ItemGroup>
     <ProjectReference Include="..\ref\System.Runtime.Caching.csproj">
-      <SupportedFramework>uap10.0.16299;netcoreapp2.0;net45;$(AllXamarinFrameworks)</SupportedFramework>
+      <SupportedFramework>uap10.0.16299;netcoreapp2.0;net461;$(AllXamarinFrameworks)</SupportedFramework>
     </ProjectReference>
     <ProjectReference Include="..\src\System.Runtime.Caching.csproj" />
-    <InboxOnTargetFramework Include="net45">
+    <InboxOnTargetFramework Include="net461">
       <AsFrameworkReference>true</AsFrameworkReference>
     </InboxOnTargetFramework>
     <InboxOnTargetFramework Include="$(AllXamarinFrameworks)" />
     <File Include="$(PlaceHolderFile)">
-      <TargetPath>runtimes/win/lib/net45</TargetPath>
+      <TargetPath>runtimes/win/lib/net461</TargetPath>
     </File>
   </ItemGroup>
   <Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.targets))" />
index 95b425d..6f18ba2 100644 (file)
@@ -3,7 +3,7 @@
   <ItemGroup>
     <PackageIndex Include="$(PkgDir)baseline\packageBaseline.1.1.json" />
     <ProjectReference Include="..\ref\System.Runtime.CompilerServices.Unsafe.csproj">
-      <SupportedFramework>net45;netcoreapp2.0;uap10.0.16299;$(AllXamarinFrameworks)</SupportedFramework>
+      <SupportedFramework>net461;netcoreapp2.0;uap10.0.16299;$(AllXamarinFrameworks)</SupportedFramework>
     </ProjectReference>
     <ProjectReference Include="..\src\System.Runtime.CompilerServices.Unsafe.ilproj" />
 
@@ -17,7 +17,7 @@
     </ValidatePackageSuppression>
 
     <!-- Exclude TFMs that aren't supported by the package anymore from validation. -->
-    <ExcludeHarvestedSupportedFramework Include="netcoreapp1.0;netcoreapp1.1;netcore45;netcore451;netcore50;uap10.0;wp8;wpa81" />
+    <ExcludeHarvestedSupportedFramework Include="netcoreapp1.0;netcoreapp1.1;netcore45;netcore451;netcore50;uap10.0;wp8;wpa81;net45;net451;net46" />
   </ItemGroup>
   <Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.targets))" />
 </Project>
\ No newline at end of file
index 3b9a084..50264a4 100644 (file)
@@ -3,8 +3,7 @@
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
     <CLSCompliant>false</CLSCompliant>
     <Nullable>enable</Nullable>
-    <TargetFrameworks>netstandard2.1;netstandard2.0;net461;net45</TargetFrameworks>
-    <ExcludeFromPackage Condition="'$(TargetFramework)' == 'net45'">true</ExcludeFromPackage>
+    <TargetFrameworks>netstandard2.1;netstandard2.0;net461</TargetFrameworks>
   </PropertyGroup>
   <ItemGroup>
     <Compile Include="System.Runtime.CompilerServices.Unsafe.cs" />
index 7efe0fd..1717166 100644 (file)
@@ -1,6 +1,6 @@
 <Project Sdk="Microsoft.NET.Sdk.IL">
   <PropertyGroup>
-    <TargetFrameworks>$(NetCoreAppCurrent);netstandard2.0;netcoreapp2.0;net45</TargetFrameworks>
+    <TargetFrameworks>$(NetCoreAppCurrent);netstandard2.0;netcoreapp2.0;net461</TargetFrameworks>
     <ExcludeCurrentNetCoreAppFromPackage>true</ExcludeCurrentNetCoreAppFromPackage>
     <!-- Make sure that the DebuggableAttribute is set properly. -->
     <DebugOptimization>IMPL</DebugOptimization>
@@ -14,9 +14,9 @@
     <CoreAssembly>System.Runtime</CoreAssembly>
     <CoreAssembly Condition="'$(TargetFramework)' == 'netstandard2.0'">netstandard</CoreAssembly>
   </PropertyGroup>
-  <PropertyGroup Condition="$(TargetFramework.StartsWith('net4'))">
+  <PropertyGroup Condition="'$(TargetFramework)' == 'net461'">
     <CoreAssembly>mscorlib</CoreAssembly>
-    <ExtraMacros>#define net45</ExtraMacros>
+    <ExtraMacros>#define $(TargetFramework)</ExtraMacros>
   </PropertyGroup>
   <ItemGroup>
     <Compile Include="System.Runtime.CompilerServices.Unsafe.il" />
@@ -24,7 +24,7 @@
   <ItemGroup>
     <!-- mscorlib is passed in as an explicit reference from C# targets but not via the IL SDK. -->
     <Reference Include="$(CoreAssembly)"
-               Condition="!$(TargetFramework.StartsWith('netstandard'))" />
+               Condition="'$(TargetFramework)' != 'netstandard2.0'" />
   </ItemGroup>
 
   <Target Name="GenerateVersionFile"
index 81e5c8b..b34710d 100644 (file)
@@ -2,10 +2,10 @@
   <Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))" />
   <ItemGroup>
     <ProjectReference Include="..\ref\System.Speech.csproj">
-      <SupportedFramework>netcoreapp2.0;net45;uap10.0.16299;$(AllXamarinFrameworks)</SupportedFramework>
+      <SupportedFramework>netcoreapp2.0;net461;uap10.0.16299;$(AllXamarinFrameworks)</SupportedFramework>
     </ProjectReference>
     <ProjectReference Include="..\src\System.Speech.csproj" />
-    <InboxOnTargetFramework Include="net45">
+    <InboxOnTargetFramework Include="net461">
       <AsFrameworkReference>true</AsFrameworkReference>
     </InboxOnTargetFramework>
     <NETStandardCompatError Include="netcoreapp2.0" Supported="netcoreapp3.1" />