DataProtection 259 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  1. commit f0fef3f20dacd0760cffa57e657a35329f865def
  2. Author: Pranav K <[email protected]>
  3. Date: Mon Nov 13 15:27:54 2017 -0800
  4. Update samples and tests to target netcoreapp2.1
  5. diff --git a/Directory.Build.props b/Directory.Build.props
  6. index fb41a883336..1bcd7ca4376 100644
  7. --- a/Directory.Build.props
  8. +++ b/Directory.Build.props
  9. @@ -1,4 +1,8 @@
  10. <Project>
  11. + <Import
  12. + Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), AspNetCoreSettings.props))\AspNetCoreSettings.props"
  13. + Condition=" '$(CI)' != 'true' AND '$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), AspNetCoreSettings.props))' != '' " />
  14. +
  15. <Import Project="version.props" />
  16. <Import Project="build\dependencies.props" />
  17. diff --git a/korebuild-lock.txt b/korebuild-lock.txt
  18. index 45463cc71ec..95f46130145 100644
  19. --- a/korebuild-lock.txt
  20. +++ b/korebuild-lock.txt
  21. @@ -1,2 +1,2 @@
  22. -version:2.1.0-preview1-15549
  23. -commithash:f570e08585fec510dd60cd4bfe8795388b757a95
  24. +version:2.1.0-preview1-15567
  25. +commithash:903e3104807b1bb8cddd28bdef205b1e2dc021d1
  26. diff --git a/samples/AzureBlob/AzureBlob.csproj b/samples/AzureBlob/AzureBlob.csproj
  27. index a9388ad953e..8ba3d51f0ff 100644
  28. --- a/samples/AzureBlob/AzureBlob.csproj
  29. +++ b/samples/AzureBlob/AzureBlob.csproj
  30. @@ -1,7 +1,7 @@
  31. <Project Sdk="Microsoft.NET.Sdk">
  32. <PropertyGroup>
  33. - <TargetFramework>netcoreapp2.0</TargetFramework>
  34. + <TargetFramework>netcoreapp2.1</TargetFramework>
  35. <OutputType>exe</OutputType>
  36. </PropertyGroup>
  37. diff --git a/samples/AzureKeyVault/AzureKeyVault.csproj b/samples/AzureKeyVault/AzureKeyVault.csproj
  38. index a4ca09bc1eb..ce4ae014085 100644
  39. --- a/samples/AzureKeyVault/AzureKeyVault.csproj
  40. +++ b/samples/AzureKeyVault/AzureKeyVault.csproj
  41. @@ -1,7 +1,7 @@
  42. <Project Sdk="Microsoft.NET.Sdk">
  43. <PropertyGroup>
  44. - <TargetFramework>netcoreapp2.0</TargetFramework>
  45. + <TargetFramework>netcoreapp2.1</TargetFramework>
  46. <OutputType>exe</OutputType>
  47. </PropertyGroup>
  48. diff --git a/samples/CustomEncryptorSample/CustomEncryptorSample.csproj b/samples/CustomEncryptorSample/CustomEncryptorSample.csproj
  49. index d6978a84947..1cfe237b50c 100644
  50. --- a/samples/CustomEncryptorSample/CustomEncryptorSample.csproj
  51. +++ b/samples/CustomEncryptorSample/CustomEncryptorSample.csproj
  52. @@ -1,7 +1,7 @@
  53. <Project Sdk="Microsoft.NET.Sdk">
  54. <PropertyGroup>
  55. - <TargetFrameworks>net461;netcoreapp2.0</TargetFrameworks>
  56. + <TargetFrameworks>net461;netcoreapp2.1</TargetFrameworks>
  57. <OutputType>exe</OutputType>
  58. </PropertyGroup>
  59. diff --git a/samples/KeyManagementSample/KeyManagementSample.csproj b/samples/KeyManagementSample/KeyManagementSample.csproj
  60. index a1688c3d1b9..e240e30b6d6 100644
  61. --- a/samples/KeyManagementSample/KeyManagementSample.csproj
  62. +++ b/samples/KeyManagementSample/KeyManagementSample.csproj
  63. @@ -1,7 +1,7 @@
  64. <Project Sdk="Microsoft.NET.Sdk">
  65. <PropertyGroup>
  66. - <TargetFrameworks>net461;netcoreapp2.0</TargetFrameworks>
  67. + <TargetFrameworks>net461;netcoreapp2.1</TargetFrameworks>
  68. <OutputType>exe</OutputType>
  69. </PropertyGroup>
  70. diff --git a/samples/NonDISample/NonDISample.csproj b/samples/NonDISample/NonDISample.csproj
  71. index 50244683718..168e26a249b 100644
  72. --- a/samples/NonDISample/NonDISample.csproj
  73. +++ b/samples/NonDISample/NonDISample.csproj
  74. @@ -1,7 +1,7 @@
  75. <Project Sdk="Microsoft.NET.Sdk">
  76. <PropertyGroup>
  77. - <TargetFrameworks>net461;netcoreapp2.0</TargetFrameworks>
  78. + <TargetFrameworks>net461;netcoreapp2.1</TargetFrameworks>
  79. <OutputType>exe</OutputType>
  80. </PropertyGroup>
  81. diff --git a/samples/Redis/Redis.csproj b/samples/Redis/Redis.csproj
  82. index cbaea96c413..dc79399c6cb 100644
  83. --- a/samples/Redis/Redis.csproj
  84. +++ b/samples/Redis/Redis.csproj
  85. @@ -1,7 +1,7 @@
  86. <Project Sdk="Microsoft.NET.Sdk">
  87. <PropertyGroup>
  88. - <TargetFrameworks>net461;netcoreapp2.0</TargetFrameworks>
  89. + <TargetFrameworks>net461;netcoreapp2.1</TargetFrameworks>
  90. <OutputType>exe</OutputType>
  91. </PropertyGroup>
  92. diff --git a/test/Directory.Build.props b/test/Directory.Build.props
  93. index 8a1b153e106..9d4d4a902c7 100644
  94. --- a/test/Directory.Build.props
  95. +++ b/test/Directory.Build.props
  96. @@ -1,6 +1,13 @@
  97. <Project>
  98. <Import Project="..\Directory.Build.props" />
  99. + <PropertyGroup>
  100. + <DeveloperBuildTestTfms>netcoreapp2.1</DeveloperBuildTestTfms>
  101. + <StandardTestTfms>$(DeveloperBuildTestTfms)</StandardTestTfms>
  102. + <StandardTestTfms Condition=" '$(DeveloperBuild)' != 'true' ">netcoreapp2.1;netcoreapp2.0</StandardTestTfms>
  103. + <StandardTestTfms Condition=" '$(DeveloperBuild)' != 'true' AND '$(OS)' == 'Windows_NT' ">$(StandardTestTfms);net461</StandardTestTfms>
  104. + </PropertyGroup>
  105. +
  106. <ItemGroup>
  107. <PackageReference Include="Internal.AspNetCore.Sdk" PrivateAssets="All" Version="$(InternalAspNetCoreSdkPackageVersion)" />
  108. <PackageReference Include="Microsoft.AspNetCore.Testing" Version="$(MicrosoftAspNetCoreTestingPackageVersion)" />
  109. diff --git a/test/Microsoft.AspNetCore.Cryptography.Internal.Test/Microsoft.AspNetCore.Cryptography.Internal.Test.csproj b/test/Microsoft.AspNetCore.Cryptography.Internal.Test/Microsoft.AspNetCore.Cryptography.Internal.Test.csproj
  110. index 483ddeda3fd..759f10679da 100644
  111. --- a/test/Microsoft.AspNetCore.Cryptography.Internal.Test/Microsoft.AspNetCore.Cryptography.Internal.Test.csproj
  112. +++ b/test/Microsoft.AspNetCore.Cryptography.Internal.Test/Microsoft.AspNetCore.Cryptography.Internal.Test.csproj
  113. @@ -1,8 +1,7 @@
  114. <Project Sdk="Microsoft.NET.Sdk">
  115. <PropertyGroup>
  116. - <TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>
  117. - <TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
  118. + <TargetFrameworks>$(StandardTestTfms)</TargetFrameworks>
  119. <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
  120. </PropertyGroup>
  121. diff --git a/test/Microsoft.AspNetCore.Cryptography.KeyDerivation.Test/Microsoft.AspNetCore.Cryptography.KeyDerivation.Test.csproj b/test/Microsoft.AspNetCore.Cryptography.KeyDerivation.Test/Microsoft.AspNetCore.Cryptography.KeyDerivation.Test.csproj
  122. index 31a604f3053..a475ac199d1 100644
  123. --- a/test/Microsoft.AspNetCore.Cryptography.KeyDerivation.Test/Microsoft.AspNetCore.Cryptography.KeyDerivation.Test.csproj
  124. +++ b/test/Microsoft.AspNetCore.Cryptography.KeyDerivation.Test/Microsoft.AspNetCore.Cryptography.KeyDerivation.Test.csproj
  125. @@ -1,8 +1,7 @@
  126. <Project Sdk="Microsoft.NET.Sdk">
  127. <PropertyGroup>
  128. - <TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>
  129. - <TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
  130. + <TargetFrameworks>$(StandardTestTfms)</TargetFrameworks>
  131. <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
  132. </PropertyGroup>
  133. diff --git a/test/Microsoft.AspNetCore.DataProtection.Abstractions.Test/Microsoft.AspNetCore.DataProtection.Abstractions.Test.csproj b/test/Microsoft.AspNetCore.DataProtection.Abstractions.Test/Microsoft.AspNetCore.DataProtection.Abstractions.Test.csproj
  134. index ccb99debff7..1da22cec0df 100644
  135. --- a/test/Microsoft.AspNetCore.DataProtection.Abstractions.Test/Microsoft.AspNetCore.DataProtection.Abstractions.Test.csproj
  136. +++ b/test/Microsoft.AspNetCore.DataProtection.Abstractions.Test/Microsoft.AspNetCore.DataProtection.Abstractions.Test.csproj
  137. @@ -1,8 +1,7 @@
  138. <Project Sdk="Microsoft.NET.Sdk">
  139. <PropertyGroup>
  140. - <TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>
  141. - <TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
  142. + <TargetFrameworks>$(StandardTestTfms)</TargetFrameworks>
  143. </PropertyGroup>
  144. <ItemGroup>
  145. diff --git a/test/Microsoft.AspNetCore.DataProtection.AzureKeyVault.Test/Microsoft.AspNetCore.DataProtection.AzureKeyVault.Test.csproj b/test/Microsoft.AspNetCore.DataProtection.AzureKeyVault.Test/Microsoft.AspNetCore.DataProtection.AzureKeyVault.Test.csproj
  146. index 753d0a1041d..c5ffd2f4e3b 100644
  147. --- a/test/Microsoft.AspNetCore.DataProtection.AzureKeyVault.Test/Microsoft.AspNetCore.DataProtection.AzureKeyVault.Test.csproj
  148. +++ b/test/Microsoft.AspNetCore.DataProtection.AzureKeyVault.Test/Microsoft.AspNetCore.DataProtection.AzureKeyVault.Test.csproj
  149. @@ -1,8 +1,7 @@
  150. <Project Sdk="Microsoft.NET.Sdk">
  151. <PropertyGroup>
  152. - <TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>
  153. - <TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
  154. + <TargetFrameworks>$(StandardTestTfms)</TargetFrameworks>
  155. <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
  156. </PropertyGroup>
  157. diff --git a/test/Microsoft.AspNetCore.DataProtection.AzureStorage.Test/Microsoft.AspNetCore.DataProtection.AzureStorage.Test.csproj b/test/Microsoft.AspNetCore.DataProtection.AzureStorage.Test/Microsoft.AspNetCore.DataProtection.AzureStorage.Test.csproj
  158. index 018c5da2fc5..86443475721 100644
  159. --- a/test/Microsoft.AspNetCore.DataProtection.AzureStorage.Test/Microsoft.AspNetCore.DataProtection.AzureStorage.Test.csproj
  160. +++ b/test/Microsoft.AspNetCore.DataProtection.AzureStorage.Test/Microsoft.AspNetCore.DataProtection.AzureStorage.Test.csproj
  161. @@ -1,8 +1,7 @@
  162. <Project Sdk="Microsoft.NET.Sdk">
  163. <PropertyGroup>
  164. - <TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>
  165. - <TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
  166. + <TargetFrameworks>$(StandardTestTfms)</TargetFrameworks>
  167. <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
  168. </PropertyGroup>
  169. diff --git a/test/Microsoft.AspNetCore.DataProtection.Extensions.Test/Microsoft.AspNetCore.DataProtection.Extensions.Test.csproj b/test/Microsoft.AspNetCore.DataProtection.Extensions.Test/Microsoft.AspNetCore.DataProtection.Extensions.Test.csproj
  170. index 63889be38c6..29cf82928f3 100644
  171. --- a/test/Microsoft.AspNetCore.DataProtection.Extensions.Test/Microsoft.AspNetCore.DataProtection.Extensions.Test.csproj
  172. +++ b/test/Microsoft.AspNetCore.DataProtection.Extensions.Test/Microsoft.AspNetCore.DataProtection.Extensions.Test.csproj
  173. @@ -1,8 +1,7 @@
  174. <Project Sdk="Microsoft.NET.Sdk">
  175. <PropertyGroup>
  176. - <TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>
  177. - <TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
  178. + <TargetFrameworks>$(StandardTestTfms)</TargetFrameworks>
  179. </PropertyGroup>
  180. <ItemGroup>
  181. diff --git a/test/Microsoft.AspNetCore.DataProtection.Redis.Test/Microsoft.AspNetCore.DataProtection.Redis.Test.csproj b/test/Microsoft.AspNetCore.DataProtection.Redis.Test/Microsoft.AspNetCore.DataProtection.Redis.Test.csproj
  182. index 75af7061ff8..d359ab936e7 100644
  183. --- a/test/Microsoft.AspNetCore.DataProtection.Redis.Test/Microsoft.AspNetCore.DataProtection.Redis.Test.csproj
  184. +++ b/test/Microsoft.AspNetCore.DataProtection.Redis.Test/Microsoft.AspNetCore.DataProtection.Redis.Test.csproj
  185. @@ -1,8 +1,7 @@
  186. <Project Sdk="Microsoft.NET.Sdk">
  187. <PropertyGroup>
  188. - <TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>
  189. - <TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
  190. + <TargetFrameworks>$(StandardTestTfms)</TargetFrameworks>
  191. </PropertyGroup>
  192. <ItemGroup>
  193. diff --git a/test/Microsoft.AspNetCore.DataProtection.Test/AnonymousImpersonation.cs b/test/Microsoft.AspNetCore.DataProtection.Test/AnonymousImpersonation.cs
  194. index 15fd53ee6a5..b8ecc36c265 100644
  195. --- a/test/Microsoft.AspNetCore.DataProtection.Test/AnonymousImpersonation.cs
  196. +++ b/test/Microsoft.AspNetCore.DataProtection.Test/AnonymousImpersonation.cs
  197. @@ -86,7 +86,7 @@ namespace Microsoft.AspNetCore.DataProtection
  198. }
  199. }
  200. }
  201. -#elif NETCOREAPP2_0
  202. +#elif NETCOREAPP2_0 || NETCOREAPP2_1
  203. #else
  204. #error Target framework needs to be updated
  205. #endif
  206. diff --git a/test/Microsoft.AspNetCore.DataProtection.Test/Microsoft.AspNetCore.DataProtection.Test.csproj b/test/Microsoft.AspNetCore.DataProtection.Test/Microsoft.AspNetCore.DataProtection.Test.csproj
  207. index 1ce0d356801..54469e40632 100644
  208. --- a/test/Microsoft.AspNetCore.DataProtection.Test/Microsoft.AspNetCore.DataProtection.Test.csproj
  209. +++ b/test/Microsoft.AspNetCore.DataProtection.Test/Microsoft.AspNetCore.DataProtection.Test.csproj
  210. @@ -1,8 +1,7 @@
  211. <Project Sdk="Microsoft.NET.Sdk">
  212. <PropertyGroup>
  213. - <TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>
  214. - <TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
  215. + <TargetFrameworks>$(StandardTestTfms)</TargetFrameworks>
  216. <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
  217. </PropertyGroup>
  218. diff --git a/test/Microsoft.AspNetCore.DataProtection.Test/TypeForwardingActivatorTests.cs b/test/Microsoft.AspNetCore.DataProtection.Test/TypeForwardingActivatorTests.cs
  219. index ab5252b1f2d..2b8931c98eb 100644
  220. --- a/test/Microsoft.AspNetCore.DataProtection.Test/TypeForwardingActivatorTests.cs
  221. +++ b/test/Microsoft.AspNetCore.DataProtection.Test/TypeForwardingActivatorTests.cs
  222. @@ -113,7 +113,7 @@ namespace Microsoft.AspNetCore.DataProtection
  223. var domain = AppDomain.CreateDomain("TestDomain", null, setupInfo);
  224. var wrappedTestClass = (TypeForwardingActivatorTests)domain.CreateInstanceAndUnwrap(GetType().Assembly.FullName, typeof(TypeForwardingActivatorTests).FullName);
  225. wrappedTestClass.CreateInstance_ForwardsAcrossVersionChangesImpl(version);
  226. -#elif NETCOREAPP2_0
  227. +#elif NETCOREAPP2_0 || NETCOREAPP2_1
  228. CreateInstance_ForwardsAcrossVersionChangesImpl(version);
  229. #else
  230. #error Target framework should be updated
  231. diff --git a/test/Microsoft.AspNetCore.DataProtection.Test/XmlEncryption/DpapiXmlEncryptionTests.cs b/test/Microsoft.AspNetCore.DataProtection.Test/XmlEncryption/DpapiXmlEncryptionTests.cs
  232. index 6806048d550..79dcff64af0 100644
  233. --- a/test/Microsoft.AspNetCore.DataProtection.Test/XmlEncryption/DpapiXmlEncryptionTests.cs
  234. +++ b/test/Microsoft.AspNetCore.DataProtection.Test/XmlEncryption/DpapiXmlEncryptionTests.cs
  235. @@ -53,7 +53,7 @@ namespace Microsoft.AspNetCore.DataProtection.XmlEncryption
  236. ExceptionAssert2.ThrowsCryptographicException(() =>
  237. AnonymousImpersonation.Run(() => decryptor.Decrypt(encryptedXmlInfo.EncryptedElement)));
  238. }
  239. -#elif NETCOREAPP2_0
  240. +#elif NETCOREAPP2_0 || NETCOREAPP2_1
  241. #else
  242. #error Target framework needs to be updated
  243. #endif