Fix DirectoryServices.Protocols packaging and configurations for compat pack (dotnet...
authorSantiago Fernandez Madero <safern@microsoft.com>
Mon, 30 Oct 2017 14:14:08 +0000 (07:14 -0700)
committerStephen Toub <stoub@microsoft.com>
Mon, 30 Oct 2017 14:14:08 +0000 (10:14 -0400)
* Fix DirectoryServices.Protocols packaging and configurations for compat
pack

* Set configurations to generate PNSE when target group is netstandard since net45 is inbox and we don't support uap

Commit migrated from https://github.com/dotnet/corefx/commit/39566c3c02061db78c6068ed8310a55d4757866c

src/libraries/System.DirectoryServices.Protocols/src/Configurations.props
src/libraries/System.DirectoryServices.Protocols/src/FxCopBaseline.AnyOS.cs [deleted file]
src/libraries/System.DirectoryServices.Protocols/src/Resources/Strings.resx
src/libraries/System.DirectoryServices.Protocols/src/System.DirectoryServices.Protocols.csproj
src/libraries/System.DirectoryServices.Protocols/tests/Configurations.props
src/libraries/System.DirectoryServices.Protocols/tests/SortRequestControlTests.cs
src/libraries/System.DirectoryServices.Protocols/tests/System.DirectoryServices.Protocols.Tests.csproj

index ae7f026..94ac07f 100644 (file)
@@ -1,9 +1,13 @@
 <?xml version="1.0" encoding="utf-8"?>
 <Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <PropertyGroup>
+    <PackageConfigurations>
+      netstandard;
+      netcoreapp2.0-Windows_NT;
+    </PackageConfigurations>
     <BuildConfigurations>
-        netstandard-Windows_NT;
-        netstandard;
+      $(PackageConfigurations);
+      netcoreapp-Windows_NT;
     </BuildConfigurations>
   </PropertyGroup>
 </Project>
diff --git a/src/libraries/System.DirectoryServices.Protocols/src/FxCopBaseline.AnyOS.cs b/src/libraries/System.DirectoryServices.Protocols/src/FxCopBaseline.AnyOS.cs
deleted file mode 100644 (file)
index 8f8b8d9..0000000
+++ /dev/null
@@ -1 +0,0 @@
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA1821", Justification = "Finalizer has implementation in Windows version.")]
\ No newline at end of file
index 528dff0..6e3d8ea 100644 (file)
   <data name="InvliadRequestType" xml:space="preserve">
     <value>The specified request is not supported.</value>
   </data>
+  <data name="DirectoryServicesProtocols_PlatformNotSupported" xml:space="preserve">
+    <value>System.DirectoryServices.Protocols is not supported on this platform.</value>
+  </data>
 </root>
\ No newline at end of file
index 03773f2..f758cf4 100644 (file)
@@ -9,16 +9,15 @@
     <!-- Although we have a netstandard configuration, we know we are not currently UAP compatible-->
     <UWPCompatible>false</UWPCompatible>
     <IncludeDllSafeSearchPathAttribute>true</IncludeDllSafeSearchPathAttribute>
-    <GeneratePlatformNotSupportedAssembly Condition="'$(TargetsWindows)' != 'true'">true</GeneratePlatformNotSupportedAssembly>
+    <GeneratePlatformNotSupportedAssemblyMessage Condition="'$(TargetGroup)' == 'netstandard'">SR.DirectoryServicesProtocols_PlatformNotSupported</GeneratePlatformNotSupportedAssemblyMessage>
   </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Windows_NT-Debug|AnyCPU'" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Windows_NT-Release|AnyCPU'" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp2.0-Windows_NT-Debug|AnyCPU'" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp2.0-Windows_NT-Release|AnyCPU'" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Windows_NT-Debug|AnyCPU'" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Windows_NT-Release|AnyCPU'" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Debug|AnyCPU'" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Release|AnyCPU'" />
-  <ItemGroup Condition="'$(TargetsWindows)' != 'true'">
-    <Compile Include="FxCopBaseline.AnyOS.cs" />
-  </ItemGroup>
-  <ItemGroup Condition="'$(TargetsWindows)' == 'true'">
+  <ItemGroup Condition="'$(TargetGroup)' != 'netstandard'">
     <Compile Include="System\DirectoryServices\Protocols\common\AuthTypes.cs" />
     <Compile Include="System\DirectoryServices\Protocols\common\BerConverter.cs" />
     <Compile Include="System\DirectoryServices\Protocols\common\DereferenceAlias.cs" />
     <Reference Include="System.Security.Permissions" />
     <Reference Include="System.Security.Principal.Windows" />
   </ItemGroup>
+  <ItemGroup Condition="'$(TargetGroup)' != 'netstandard'">
+    <Reference Include="System.Collections" />
+    <Reference Include="System.Collections.NonGeneric" />
+    <Reference Include="System.Collections.Specialized" />
+    <Reference Include="System.ComponentModel.TypeConverter" />
+    <Reference Include="System.Diagnostics.Debug" />
+    <Reference Include="System.Net.Primitives" />
+    <Reference Include="System.Resources.ResourceManager" />
+    <Reference Include="System.Runtime" />
+    <Reference Include="System.Runtime.Extensions" />
+    <Reference Include="System.Runtime.InteropServices" />
+    <Reference Include="System.Security.Cryptography.X509Certificates" />
+    <Reference Include="System.Text.Encoding.Extensions" />
+    <Reference Include="System.Threading" />
+    <Reference Include="System.Threading.Thread" />
+    <Reference Include="System.Xml.ReaderWriter" />
+  </ItemGroup>
+  <ItemGroup Condition="'$(TargetGroup)' == 'netcoreapp'">
+    <Reference Include="System.ComponentModel.Primitives" />
+  </ItemGroup>
   <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
 </Project>
\ No newline at end of file
index ed4061c..d8cd9ec 100644 (file)
@@ -2,7 +2,7 @@
 <Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <PropertyGroup>
     <BuildConfigurations>
-        netstandard-Windows_NT;
+        netcoreapp-Windows_NT;
     </BuildConfigurations>
   </PropertyGroup>
 </Project>
index 485f60e..52407ee 100644 (file)
@@ -92,7 +92,7 @@ namespace System.DirectoryServices.Protocols.Tests
         }
 
         [Fact]
-        [ActiveIssue("https://github.com/dotnet/corefx/issues/21217", TargetFrameworkMonikers.UapAot)]
+        [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "The field _keys in full framework is called keys, so GetField returns null and ends up in a NRE")]
         public void SortKeys_GetNull_ReturnsEmptyArray()
         {
             var control = new SortRequestControl();
index d537eef..9d29344 100644 (file)
@@ -4,8 +4,8 @@
   <PropertyGroup>
     <ProjectGuid>{6638C675-CD62-408F-AB3B-AAFD8A906A96}</ProjectGuid>
   </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Windows_NT-Debug|AnyCPU'" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Windows_NT-Release|AnyCPU'" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Windows_NT-Debug|AnyCPU'" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Windows_NT-Release|AnyCPU'" />
   <ItemGroup>
     <Compile Include="BerConverterTests.cs" />
     <Compile Include="LdapSessionOptionsTests.cs" />